Running Select Query in MS Access 2007 vba based on a value in a textbox (1 Viewer)

wchitamb

New member
Local time
Today, 15:19
Joined
May 24, 2016
Messages
6
Hi guys ,How do I run a query based on a result on a form (unbound text) I have a database that I have created and I have a result on the form and I want to click a button that runs query based on that result... how best can I do that? If I click on the button I want it to return all products associated with that manufacture -: at the moment the Query I am using is asking me to put the parameter manually (yet I want it to pick from the selection)

I have three tables eg. Countries, Manufactures & Products. if i click on a country i get a list of manufactures in that country and if i click on the manufactureID & run the Qry i want it to select all the products associated with that manufacture




Country List Manufacture List
2001 AB1
2002 AB2
2003 AB3 (Button)
2004 AB4
2005 AB5
2006 AB6



Country 2001

ManufactureID AB2
 

CJ_London

Super Moderator
Staff member
Local time
Today, 15:19
Joined
Feb 19, 2013
Messages
16,555
change this bit in your query

at the moment the Query I am using is asking me to put the parameter manually

to [Forms]![myForm]![controlName]

you can use the expression builder to navigate to your form and control
 

wchitamb

New member
Local time
Today, 15:19
Joined
May 24, 2016
Messages
6
Thanks it worked, I had a typing error on my form name. when i did the copy and past it work. Thanks so much.
 

Users who are viewing this thread

Top Bottom