Can a value in a parameter query be chosen from a drop down menu?

  • Thread starter Thread starter Access Non-Pro
  • Start date Start date
A

Access Non-Pro

This has been addressed before, but I wanted clarification on exactly how to
do it. I understand that the query pop-up window can't have a drop-down
list, but that there is some other way to accomplish this with a form.
Please explain. Thanks.
 
Create a form with a combo box that shows the data you want to use.

In the query put something like the following, with the proper form and
combo box name, in the criteria for the field:

[Forms]![frmParameterCombo]![cboVendor]

You can run the query (or a form or report) with code like so on the OnClick
event of a command button:

Private Sub cmdRunQuery_Click()
DoCmd.OpenQuery "qryParameterCombo"
Me.Visible = False
End Sub

Note that the form must stay open for the query to work; however, the form
can be invisible.
 
Back
Top