I have a report that I want the user to be able to run from a form and select a sort order from a combo box.
Currently I use an If statement to check which value is chosen from the combo box.
I have 3 versions of the same report:
rpt_Test_SortByX
rpt_Test_SortByY
rpt_Test_SortByZ
So, based on the if statement in the Command Button click event, I call one of the three reports.
I have to believe that there's a better way of doing this. Can I make the sort order in the report dependant on the combo box choice on the form?
One thought was to have insert the selected value from the combo box into a temp table and include that temp table as a value in the query that builds the report. Then I could select that value from the sort box in the report.
Would this work or is there a better alternative?
Currently I use an If statement to check which value is chosen from the combo box.
I have 3 versions of the same report:
rpt_Test_SortByX
rpt_Test_SortByY
rpt_Test_SortByZ
So, based on the if statement in the Command Button click event, I call one of the three reports.
I have to believe that there's a better way of doing this. Can I make the sort order in the report dependant on the combo box choice on the form?
One thought was to have insert the selected value from the combo box into a temp table and include that temp table as a value in the query that builds the report. Then I could select that value from the sort box in the report.
Would this work or is there a better alternative?