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

DoCmd.RunSQL and parentheses in field name

Status
Not open for further replies.

th2002

Programmer
Jan 22, 2004
5
NO
Hi!

Table name: Table1
Field name: OrderNumber(AutoNumber)

I need to run SQL using this field name and now parentheses in the name is giving me hard times.

Code:
DoCmd.RunSQL "DELETE * FROM Table1 WHERE OrderNumber(AutoNumber) LIKE " & intNumber & " ;"

This statement would work if there wasn't parentheses in the name. Is there someway to use parentheses in that kind statement? It's too late to change the field name...

Thanks if somebody has an answer to this!

-TH-
 
Hi

DoCmd.RunSQL "DELETE * FROM Table1 WHERE [OrderNumber(AutoNumber)] LIKE " & intNumber & " ;"

should work

and let this be a lesson in naming of columns and other objects

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top