Using a combo box to pass information to query

G

Grant

Hey all,
I am very rusty at my Access programming and have
forgotten how this could be done. I have a form that I am
creating and what I want to do is when a user picks a
value out of a combo box I want that value to be passed to
a query as the selection criteria rather than the user
having to type in the selection criteria each time. Any
help would be appreciated !

Thanks,

Grant
 
S

sam

Basically, you set up the form with the combo and then set
up the query with something like the following in the
appropriate criteria. If you ope the form and the query you
can just use 'build' to create it but it will be the same
syntax as this.

[Forms]![myform]![mycombo]

hope it helps
 
M

Marshall Barton

Grant said:
I am very rusty at my Access programming and have
forgotten how this could be done. I have a form that I am
creating and what I want to do is when a user picks a
value out of a combo box I want that value to be passed to
a query as the selection criteria rather than the user
having to type in the selection criteria each time.

Well, in some cases, you can set the appropriate query
field's criteria to reference the combo box:
Forms!yourformname.yourcomboboxname

and then have the combo box's AfterUpdate event open the
query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top