I am trying to run a specific query that is pre-defined as a stand-alone query inside of my VBA Code using the "RUNSQL" command as below:
the query contains:
The Error Message that I am getting is:
I also get the same Error message if I try to perform this as a Macro...
When I go the the query screen and double click on the query it runs with no issues and performs the updates... What am i doing wrong???
Thanks in advance
Code:
DoCmd.RunSQL "#GetFirstCustomerCall", 0
the query contains:
Code:
UPDATE tblCDNCustData SET tblCDNCustData.tblFCareRepName = funReturnUser()
WHERE (((tblCDNCustData.[Ship To Phone Num])=(Select top 1 [Ship To Phone Num] from tblCDNCustData where tblFCareRepName is null and tblFCustCalled = false and tblEstDeliveryDate is not null)));
The Error Message that I am getting is:
Code:
"Invalid SQL Statement; expected 'Delete', 'Insert', Procedure','Select', or 'Update'
I also get the same Error message if I try to perform this as a Macro...
When I go the the query screen and double click on the query it runs with no issues and performs the updates... What am i doing wrong???
Thanks in advance