Link to home
Start Free TrialLog in
Avatar of Dustin Stanley
Dustin Stanley

asked on

Syntax Error 3075 for SQL in VBA MS Access

Hello,
I am getting a syntax error of 3075 for some SQL in VBA.

Here is what it says :
---------------------------
Error
---------------------------
Error 3075: Syntax error (missing operator) in query expression 'SKUs.SkuIDFROM SKUs INNER JOIN ReviseFixedPriceItemTemp ON SKUs.SkuID = ReviseFixedPriceItemTemp.SkuIdLongWHERE (((SKUs.SkuID)=[ReviseFixedPriceItemTemp].[SkuIdLong]))'. in Mod_ReviseBulkFixedPriceItem
---------------------------
OK  
---------------------------



What I have in my VBA is:
sSQL = "SELECT SKUs.*, SKUs.SkuID" _
& "FROM SKUs INNER JOIN ReviseFixedPriceItemTemp ON SKUs.SkuID = ReviseFixedPriceItemTemp.SkuIdLong" _
& "WHERE (((SKUs.SkuID)=[ReviseFixedPriceItemTemp].[SkuIdLong]));"

Open in new window



But when I use the same SQL in a query it works great:
SELECT SKUs.*, SKUs.SkuID
FROM SKUs INNER JOIN ReviseFixedPriceItemTemp ON SKUs.SkuID = ReviseFixedPriceItemTemp.SkuIdLong
WHERE (((SKUs.SkuID)=[ReviseFixedPriceItemTemp].[SkuIdLong]));

Open in new window



I can't figure this one out and I know it is a simple solution but I can't see it. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dustin Stanley
Dustin Stanley

ASKER

Thank you both very much for the help. All the solutions worked great. Norie you were the quickest and explained clearly. HainKurt you provided something closer to my original style. I like to keep the original style to compare to other module I use in the DB.  Littlest things like a space can throw everything off. Thanks again!