How can I make a query use a combobox?

  • Thread starter Thread starter LittleMissComputerGeek1
  • Start date Start date
L

LittleMissComputerGeek1

I am going to make myself a bit more understood this time.

I have a table with the fields:
Name of stock
Type of stock
Place Kept
Supplier name
Rating.

The field called place kept has a look-up wizard with choices such as
reception, store room etc.

I want to open up a query where the user selects from a combobox one of
these places and then it brings up everything in that place.

Eventually I need to make this into a report, but im just dealing with the
query for now.


Please help, thanks for your time.
 
LittleMissComputerGeek1 said:
I am going to make myself a bit more understood this time.

I have a table with the fields:
Name of stock
Type of stock
Place Kept
Supplier name
Rating.

The field called place kept has a look-up wizard with choices such as
reception, store room etc.

I want to open up a query where the user selects from a combobox one
of these places and then it brings up everything in that place.

Eventually I need to make this into a report, but im just dealing
with the query for now.


Please help, thanks for your time.

You cannot make this happen simply by opening the query. You have to build
a form that has a ComboBox and a CommandButton. The user opens the form,
selects from the ComboBox and then presses the button. Code behind the
button then opens the query. The query makes a reference back to the
ComboBox on the form to get its filter criteria. The SQLof the query would
have the structure...

SELECT *
FROM TableName
WHERE [Place Kept] = Forms!FormName!ComboBoxName
 
Back
Top