Passing query parameters using a form

S

Simon Cleal

I have a Make Table query with a user input parameter
[type], and I want the user to pick from a list box(called
lstType) and pass that selection to the query.

What code do I need with my command button click event to
do that?

Thanks in advance

Simon
 
J

Jeff Boyce

Simon

Actually, none! The way you "use" the form's listbox's value in your query
is to open the query in design mode and use an expression in the criterion
for that field that points back to the form. NOTE: the form will have to
be open for this to work.

The expression looks something like (actual syntax may vary -- check Access
HELP):

Forms![YourFormName]![lstType]

Good luck

Jeff Boyce
<Access MVP>
 

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