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

Quick Question - Problems referencing Table in SQL

Status
Not open for further replies.

grippy

Programmer
Dec 2, 2004
161
US
Ok guys im used to making forms so I cant figure out why my code isnt working on this table im working on. I created a table called tblSPRINTGRIP2 which has a field called make and a field called model. When i design the table I did the lookup wizard on the data field for make so that it would create a drop down box. That part works fine. Now when the model field is clicked i need a drop down that displays only items that share an ID with tblSPRINTGRIP2.make.

Say the data in the make field is 1 then i click the drop down on the model field and it says "Enter Parameter Value" then below that it says "tblSPRINTGRIP2!make" and has an empty area. If I manually type in the data of 1 then the drop down shows the correct filtered information. Problem is I cant seem to reference it properly. Here is my current SQL code on the model field

Code:
SELECT dbo_tblCarModel.ID AS Expr1, dbo_tblCarModel.model AS Expr2 FROM dbo_tblCarModel WHERE (((dbo_tblCarModel.carMakeID)=(tblSPRINTGRIP2!make))) ORDER BY dbo_tblCarModel.model;
 
I shouldnt need a SQL Join for this, i dont use one on my form and it works fine. I dont think I am calling tblSPRINTGRIP2.make correctly. All my other tables are linked tables and tblSPRINTGRIP2 is my only access created table. I dont know if that matters
 
anyone else have any ideas? seems like it should be a simple solution
 
Abandon the use of lookup fields defined in tables. If I understand your question, you want to cascade combo boxes. There is a small sample database that shows how to do this at
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top