Combo box for query Criteria

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

I was wondering if I can create a combo box with a drop down selection in a
query, instead of having to match the criteria exactly with the [Enter your
selection] in the criteria of the column. If this is possible, how would it
be coded would it still go, in the criteria or somewhere else?
 
Use this in the query as the criterion:

Forms!YourFormName!YourComboBoxName
 
I tried this and instead of a combo box with a drop dowm arrow, I got an
Enter Parameter Value looking for Forms!MyForm!MyComboBox. I noticed that in
the criteria row it shows it as [Forms]![MyForm]![MyComboBox]. Was ther
something else I was supposed to do?

Ken Snell (MVP) said:
Use this in the query as the criterion:

Forms!YourFormName!YourComboBoxName

--

Ken Snell
<MS ACCESS MVP>

Frank said:
I was wondering if I can create a combo box with a drop down selection in a
query, instead of having to match the criteria exactly with the [Enter
your
selection] in the criteria of the column. If this is possible, how would
it
be coded would it still go, in the criteria or somewhere else?
 
Did you replace YourFormName with the actual name of your form?

Did you replace YourComboBoxName with the actual name of the combo box on
your form?

If you're expecting the query to pop up a combo box for your use, that is
not how it will work. You need to have a form that has a combo box on it,
let the user select the value in the combo box, and then run the query.

--

Ken Snell
<MS ACCESS MVP>

Frank said:
I tried this and instead of a combo box with a drop dowm arrow, I got an
Enter Parameter Value looking for Forms!MyForm!MyComboBox. I noticed that
in
the criteria row it shows it as [Forms]![MyForm]![MyComboBox]. Was ther
something else I was supposed to do?

Ken Snell (MVP) said:
Use this in the query as the criterion:

Forms!YourFormName!YourComboBoxName

--

Ken Snell
<MS ACCESS MVP>

Frank said:
I was wondering if I can create a combo box with a drop down selection
in a
query, instead of having to match the criteria exactly with the [Enter
your
selection] in the criteria of the column. If this is possible, how
would
it
be coded would it still go, in the criteria or somewhere else?
 
I entered Forms!Job!HoldingCoID_Combo which is the name of the form and the
combo box in the form.

Ken Snell (MVP) said:
Did you replace YourFormName with the actual name of your form?

Did you replace YourComboBoxName with the actual name of the combo box on
your form?

If you're expecting the query to pop up a combo box for your use, that is
not how it will work. You need to have a form that has a combo box on it,
let the user select the value in the combo box, and then run the query.

--

Ken Snell
<MS ACCESS MVP>

Frank said:
I tried this and instead of a combo box with a drop dowm arrow, I got an
Enter Parameter Value looking for Forms!MyForm!MyComboBox. I noticed that
in
the criteria row it shows it as [Forms]![MyForm]![MyComboBox]. Was ther
something else I was supposed to do?

Ken Snell (MVP) said:
Use this in the query as the criterion:

Forms!YourFormName!YourComboBoxName

--

Ken Snell
<MS ACCESS MVP>

I was wondering if I can create a combo box with a drop down selection
in a
query, instead of having to match the criteria exactly with the [Enter
your
selection] in the criteria of the column. If this is possible, how
would
it
be coded would it still go, in the criteria or somewhere else?
 
Back
Top