On a form, I have several command buttons. Each button opens a preview of a basically the same report, but for different geographic regions. For the time being, I have actually created a separate report for each region by altering the base report's query criteria slightly.
This works, but I would prefer to set the query criteria in the command button code so that only one report needs to be in the database. The report has a field CountyNumber (integer), and I want to set the CountyNumber in the command buttons such that cmdCounty1 opens the report with CountyNumber=1, cmdCounty2 opens the report with CountyNumber=2, etc.
Any tips for the proper code to load the form differentially for the various buttons?