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

SQL in VBA Help 1

Status
Not open for further replies.

3239

Technical User
May 14, 2003
64
I'm fairly new to running SQL in a code module and I'm having a "Compile Error Expected: line number or label or statement or end of line error" with the folliwing code:

Code:
DOCMD.RUNSQL "SELECT SEND_REQ.PurchaseOrderID, SEND_REQ.OrderDate, " & _
"SEND_REQ.Comments, SEND_REQ.EmployeeID, Employees.FirstName & ' ' & [LastName] AS Name, & _
"Suppliers.SupplierName, DepartmentInfo.Center, DepartmentInfo.Department,  "  & _
"DepartmentInfo.Address, DepartmentInfo.City, DepartmentInfo.State, " & _
"DepartmentInfo.ZipCode, Suppliers.Address, Suppliers.City, " & _
"Suppliers.PostalCode, Suppliers.StateOrProvince INTO Temp " & _
"FROM (Employees INNER JOIN (Suppliers INNER JOIN SEND_REQ " & _
"ON Suppliers.SupplierID = SEND_REQ.SupplierID) ON " & _
"Employees.EmployeeID = SEND_REQ.EmployeeID) " & _
"INNER JOIN DepartmentInfo ON Employees.EmployeeID = DepartmentInfo.EmployeeID " & _
"IN '\\Svr-fp-rh3\groups " & _
"\Purchasing Tracking Database Systems\County Wide\Purchase Tracking System County Wide_be.mdb'
"ORDER BY SEND_REQ.PurchaseOrderID;"

Please Help!

Thanks.
 
check missing end quotes on line 2 and line 12
missing starting single quote on line 12
 
Thanks pwise! No more errors!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top