JeffBarker
Registered User.
- Local time
- Today, 05:59
- Joined
- Dec 7, 2010
- Messages
- 130
Hi guys,
I'm trying to run an INSERT INTO statement via docmd.RunSQL, and I'm stumped - I keep getting the following syntax error:
Syntax error (missing operator) in query expression '(((tblHistory.HistoryID) = 42848) AND ((LookUpAllocater.Publication) = AHCP) AND ((LookUpAllocater.Issue) = Summer 2015) AND ((LookUpPageSize.Size) = Special))'.
The code I'm running is:
I'm convinced that I'm literally a couple of character changes away from solving this, but I'll admit that I am totally stumped!
If anyone can tell me where I'm going wrong, and how to solve it, I would be most greatful!
Cheers,
Jeff.
I'm trying to run an INSERT INTO statement via docmd.RunSQL, and I'm stumped - I keep getting the following syntax error:
Syntax error (missing operator) in query expression '(((tblHistory.HistoryID) = 42848) AND ((LookUpAllocater.Publication) = AHCP) AND ((LookUpAllocater.Issue) = Summer 2015) AND ((LookUpPageSize.Size) = Special))'.
The code I'm running is:
Code:
vSQL = "INSERT INTO tblProduction_LogDate ( HistoryID, LogDate, [User], Detail )" _
& " SELECT tblHistory.HistoryID, Now() AS LogD, tblHistory.User AS UserName, 'Artwork Status changed to ' & [ArtworkStatus] & ' on ' & [Publication] & ' - ' & [Issue] & ' - ' & [lookuppagesize].[size] AS Det" _
& " FROM ((tblAllocation INNER JOIN LookUpAllocater ON tblAllocation.AllocaterID = LookUpAllocater.AllocaterID) INNER JOIN LookUpPageSize ON tblAllocation.Size = LookUpPageSize.SizeID) INNER JOIN tblHistory ON tblAllocation.HistoryID = tblHistory.HistoryID" _
& " WHERE (((tblHistory.HistoryID) = " & vRef & ") AND ((LookUpAllocater.Publication) = " & vTitle & ") AND ((LookUpAllocater.Issue) = " & vIssue & ") AND ((LookUpPageSize.Size) = " & vSize & ")) "
I'm convinced that I'm literally a couple of character changes away from solving this, but I'll admit that I am totally stumped!
If anyone can tell me where I'm going wrong, and how to solve it, I would be most greatful!

Cheers,
Jeff.