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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query with non-user parameter

Status
Not open for further replies.

almoes

Programmer
Jan 8, 2003
291
US
Hi,

I have this SQL select:

SELECT Menu.ProductName, Menu.ProductID
FROM Menu WHERE (((Menu.CategoryID)=x));

Now I would like that x matches a 1 for field1, a 2 for field2 and so on...Is this possible somehow in combination with the 'Criteria' property of the fields?

thanxs!
alej
 
Hallo,

Where is your SQL? and where is your field1, field2?

- Frink
 
Sorry, the SQL is a query applied to a Combo box and my fields are in one of the tables of the db.
 
Hallo,

If you write the RowSource in code you should be able to do something:

.RowSource="SELECT Menu.ProductName, Menu.ProductID
FROM Menu WHERE (((Menu.CategoryID)=" & x & "));"

If you explain more, then so will I :)

- Frink
 
it's ok, you already helped me! :) Did not know it was possible to write direct SQL on the rowSource property and i dod not want to write 7 queries which would only differ on the 'x' value of the previous SQL statement.

thanxs!
alej
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top