Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass Parameter from form to a query

Status
Not open for further replies.

azzi2000

MIS
Jan 28, 2004
145
US
I would like to know how to pass a parameter from a form to a query when user click a button.

ie: Form (order entry):
id, custno, address,.....
subform for the order detail
In addition I would like a
button: to list all orders for the custno via query.
Please advice,
Thank you.
Dré
 
Hi. If you have a form called Myform and an unbound textbox called Custno, then you can reference it in your query by Forms!Myform!Custno

You can put that in your criteria in your query.

ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.

 
Blorf:
Thank you. it did work
Now I have another question, (i know this should be another thread)
but how can I apply this filter to a subform.
Thank you
Dré
 
Hi. If your subform is based on the same query we just discussed, then you can do it.

Just remember that after you change your textbox, you have to requery the subform. You can do that with a Macro. The macro will run on the after update event of the text box, and will say requery, and the argument will be the name of the subform.

ChaZ

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top