simple question

  • Thread starter Thread starter marklar
  • Start date Start date
M

marklar

Guest
how would i use data from a form as part of the WHERE clause in sql?

e.g. SELECT tblANIMAL.animal_id, tblANIMAL.owner_ID FROM tblANIMAL
WHERE ((tblANIMAL.owner_ID)=(THE OWNER_ID FROM A TEXT BOX IN A FORM));
 
Last edited:
Open your query in design view.

Right click on criteria for the field where the parameter will go.

Click on Build.

In the menu find the form with your text box on it in the Forms folder. Once you have that open click the text box.

That's it.
 
e.g. SELECT tblANIMAL.animal_id, tblANIMAL.owner_ID FROM tblANIMAL
WHERE ((tblANIMAL.owner_ID)=(THE OWNER_ID FROM A TEXT BOX IN A FORM));


SELECT tblANIMAL.animal_id, tblANIMAL.owner_ID FROM tblANIMAL
WHERE ((tblANIMAL.owner_ID)=(forms![yourform]![yourtextbox]));
 
Open your query in design view.

Right click on criteria for the field where the parameter will go.

Click on Build.

In the menu find the form with your text box on it in the Forms folder. Once you have that open click the text box.

That's it.
 

Users who are viewing this thread

Back
Top Bottom