I've been stuck on one small item for awhile and it's driviing me nuts. In short, I want to run a delete query in VBA to delete records containing a billing month that's greater that a precalculated current month. The source data from another system has the dates in text format, shown as (YYYY/MM).
Here's the statement:
mySQL = "DELETE * FROM [tblBillingData]" _
& "WHERE (((tblBillingData.[Billing Month]) > PreCalcCurrentMonth));"
DoCmd.RunSQL mySQL
All variables are declared properly and I can see the PreCalcCurrentMonth when I step through the code, but when it runs the SQL statement, I'm presented with an Enter Parameter input box for the PreCalcCurrentMonth variable.
Any suggestions??
Thanks,
Ed
Here's the statement:
mySQL = "DELETE * FROM [tblBillingData]" _
& "WHERE (((tblBillingData.[Billing Month]) > PreCalcCurrentMonth));"
DoCmd.RunSQL mySQL
All variables are declared properly and I can see the PreCalcCurrentMonth when I step through the code, but when it runs the SQL statement, I'm presented with an Enter Parameter input box for the PreCalcCurrentMonth variable.
Any suggestions??
Thanks,
Ed