Pull down menus for queries.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a query where when you run it it gives you a pull down menu
to choose the data to query it by. Basically I want the dialog box to have a
pull down menu as opposed to just typing in a test criteria. This will help
my users to choose a selection if they don't know what choices there are. Can
this be done?
 
Do your users a favor and don't use parameter prompts in your queries. Use
controls on forms to collect criteria from your users. This allows users to
see multiple criteria values at one time. You can also set defaults, check
for integrity, and use fancy controls.
 
Not sure I follow you here. Are you saying create a form with controls so
they can select certain data? How exaclty would that work?
 
Secret said:
Not sure I follow you here. Are you saying create a form with
controls so they can select certain data? How exaclty would that work?

Where you now have...

SELECT * FROM SomeTable
WHERE SomeField = [Enter parameter value]

....instead use...

SELECT * FROM SomeTable
WHERE SomeField = Forms!FormName!ControlName

If "ControlName" is a ComboBox then you have what you want.
 
Forgive me for asking cause I'm a little new at this but right now I have
this in my criteria:

[Enter Disposition Code]

So when I run the query it prompts me to enter a code. But I want to be able
to have a combo box appear. So I'm not really sure what the "SELECT * FROM
SomeTable" and "WHERE SomeField" means. I understand the "=
Forms!FormName!ControlName".

Rick Brandt said:
Secret said:
Not sure I follow you here. Are you saying create a form with
controls so they can select certain data? How exaclty would that work?

Where you now have...

SELECT * FROM SomeTable
WHERE SomeField = [Enter parameter value]

....instead use...

SELECT * FROM SomeTable
WHERE SomeField = Forms!FormName!ControlName

If "ControlName" is a ComboBox then you have what you want.
 
Secret said:
Forgive me for asking cause I'm a little new at this but right now I
have this in my criteria:

[Enter Disposition Code]

So you build a form with a ComboBox and a button. The button runs the query (or
the form/report bound to the query). The ComboBox contains the valid choices
for the user and you replace [Enter Disposition Code] with
Forms!NameOfForm!NameOfComboBox.

The user the makes a choice and presses the button.
 
Ok got it. Thank you very much!

Rick Brandt said:
Secret said:
Forgive me for asking cause I'm a little new at this but right now I
have this in my criteria:

[Enter Disposition Code]

So you build a form with a ComboBox and a button. The button runs the query (or
the form/report bound to the query). The ComboBox contains the valid choices
for the user and you replace [Enter Disposition Code] with
Forms!NameOfForm!NameOfComboBox.

The user the makes a choice and presses the button.
 
Back
Top