G
Guest
I have posted this question in the query group, but I'm not sure if anyone
will see it, so I thought I would post it here as well.
I recieved a solution to a query problem ..... wanting to run a query from a
combo box selection for the parameters.
The solution I recieved is as follows-
"Make a new unbound form or use an existing form.
Add a combo box that will show the CodeID field.
Make sure the Combo Box Bound Column is the
same DataType as the CodeID field.
Add a command button.
Code the button's Click event:
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name
Name this form "ParamForm"
Code the Query CodeID field's criteria line
forms!ParamForm!ComboBoxName
Open the form.
Find the CodeID in the combo box.
Click the command button.
The query will display just those records selected.
The Form will close."
I use this code to actually open a report, however the report goes to print.
How do I get it to go to preview?
will see it, so I thought I would post it here as well.
I recieved a solution to a query problem ..... wanting to run a query from a
combo box selection for the parameters.
The solution I recieved is as follows-
"Make a new unbound form or use an existing form.
Add a combo box that will show the CodeID field.
Make sure the Combo Box Bound Column is the
same DataType as the CodeID field.
Add a command button.
Code the button's Click event:
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, Me.Name
Name this form "ParamForm"
Code the Query CodeID field's criteria line
forms!ParamForm!ComboBoxName
Open the form.
Find the CodeID in the combo box.
Click the command button.
The query will display just those records selected.
The Form will close."
I use this code to actually open a report, however the report goes to print.
How do I get it to go to preview?