I have a form whose main purpose is to define a query. The form allows the user to specify criteria for up to 4 different fields in a table. The table actually contains many more fields so the form also allows the user to select which fields will appear in the query (in a multi-select listbox). For example, the query may include 10 fields from the table with specific criteria for 2 fields. When a button on the form is clicked I generate the query.
I then want the button to create a report based on the query. I essentially want to perform the AutoReport feature that is accessible from the "reports" tab on the main database window by clicking the "new" button. Is there a way of doing this using VB? I am shying away from using OpenReport on a previously created report that shows all potential fields and then hiding fields based on what is selected on the form. The amount of variation in the number of fields makes programming for this very cumbersome. It seems that there has to be a better way. Any other suggestions?
I then want the button to create a report based on the query. I essentially want to perform the AutoReport feature that is accessible from the "reports" tab on the main database window by clicking the "new" button. Is there a way of doing this using VB? I am shying away from using OpenReport on a previously created report that shows all potential fields and then hiding fields based on what is selected on the form. The amount of variation in the number of fields makes programming for this very cumbersome. It seems that there has to be a better way. Any other suggestions?