M
Max
I am receiving a 3061 error, that emanates from the below statement. If I
remove
"([SUPPLIER SCHEDULE].[MAILING LIST] = Yes) AND" it works OK. What am i
doing wrong?
thanx
strSQL = "INSERT INTO Labels ( LabType, LabPOSOSNumber, LabLine1, LabLine2,
LabLine3, LabLine4, LabLine5) " & _
"SELECT 'S' AS Expr1, PurchaseOrd.PurchaseOrderNo, [SUPPLIER
SCHEDULE].[COMPANY NAME], [SUPPLIER SCHEDULE].[BUSINESS ADDRESS], [SUPPLIER
SCHEDULE].SUBURB, [STATE] & ' ' & [POST CODE/ZIP CODE] AS Expr2, [SUPPLIER
SCHEDULE].COUNTRY " & _
"FROM [SUPPLIER SCHEDULE] INNER JOIN PurchaseOrd ON [SUPPLIER
SCHEDULE].[SUPPLIER ID] = PurchaseOrd.SupplierId " & _
"WHERE ([SUPPLIER SCHEDULE].[MAILING LIST] = Yes) AND
(PurchaseOrd.PurchaseOrderNo = '" & strPurchaseOrderNo & "');"
remove
"([SUPPLIER SCHEDULE].[MAILING LIST] = Yes) AND" it works OK. What am i
doing wrong?
thanx
strSQL = "INSERT INTO Labels ( LabType, LabPOSOSNumber, LabLine1, LabLine2,
LabLine3, LabLine4, LabLine5) " & _
"SELECT 'S' AS Expr1, PurchaseOrd.PurchaseOrderNo, [SUPPLIER
SCHEDULE].[COMPANY NAME], [SUPPLIER SCHEDULE].[BUSINESS ADDRESS], [SUPPLIER
SCHEDULE].SUBURB, [STATE] & ' ' & [POST CODE/ZIP CODE] AS Expr2, [SUPPLIER
SCHEDULE].COUNTRY " & _
"FROM [SUPPLIER SCHEDULE] INNER JOIN PurchaseOrd ON [SUPPLIER
SCHEDULE].[SUPPLIER ID] = PurchaseOrd.SupplierId " & _
"WHERE ([SUPPLIER SCHEDULE].[MAILING LIST] = Yes) AND
(PurchaseOrd.PurchaseOrderNo = '" & strPurchaseOrderNo & "');"