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

Listbox error mesage

Status
Not open for further replies.

shaz123

Technical User
Oct 13, 2006
60
DE
I am trying to refer a listbox to a Combo box, can any see what is worng with this select statement. i keep getting meesage "syntax error in from clause"


SELECT Qry_Delivered.[Cylinder Number], Qry_Delivered.[Cylinder Barcode Label] FROM Qry_Delivered =Form!Qry_Delivered1!Person;
 
It is nearly always best to build queries using the Query Design window and then cut the SQL from SQL View. You need to add the name of the field you want to match:

[tt]SELECT Qry_Delivered.[Cylinder Number], Qry_Delivered.[Cylinder Barcode Label] FROM Qry_Delivered [blue]Where [Name of Field][/blue]=Form[red]s[/red]!Qry_Delivered1!Person;[/tt]
 
Another question if i wanted to refer to two fileds on the form would i just add "And[Line Number]" as show below:


SELECT Qry_Delivered.[Cylinder Number], Qry_Delivered.[Cylinder Barcode Label] FROM Qry_Delivered Where [Works Order Number]And [Line Number]=Forms!Qry_Delivered1!Person;
 
Not quite:

[tt]SELECT Qry_Delivered.[Cylinder Number], Qry_Delivered.[Cylinder Barcode Label] FROM Qry_Delivered Where [Works Order Number][blue]=[This Field Or Control][/blue] And [Line Number]=Forms!Qry_Delivered1!Person;[/tt]

Build you query in the Query Design Window and then switch to SQL view to see how it is all done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top