My Problem
I have a fairly straight forward autoexec macro to perform a version control check for my split database. I have a table in the frontend called LocalVersionNumber
, and a table in the backend called LiveVersionNumber
. Each version number may have multiple values (ex. which version of the backend is being used, which frontend, etc). Because of this, the value in these tables are parsed via the queries __LiveVersionParser_Q
and __LocalVersionParser_Q
. Without going into too much wasted detail, the local version number should always be equal or greater than the live version number.
I wrote up a query that compared my local & live parsed values - and via IIF expressions, determined the logic to update or keep with current version. This test query ran without issue, but now that I've pulled the logic into a autoexec macro and I'm getting the error:
Cannot find the name '__LiveVersionParser_Q' you entered in the expression.
I've double checked, and the table and fields are spelled correctly. I've even gone as far as to copy and paste the statement from the macro back into a query, and the query executes properly still.
The Code
(In Macro Builder not VBA - ugh)
"IF" Action
CDbl([__LiveVersionParser_Q].[DevelopmentVersion])
<=CDbl([__LocalVersionParser_Q].[DevelopmentVersion])
Then... execute my update frontend logic.
NOTE: For those asking "why use CDbl?", this is used because the version number is a text string with multiple values separated by ".". After parsing the versions, these strings are then compared by converting them to a double (using CDbl) to see which is greater.
Troubleshooting
As I stated earlier, this statement DOES work, just not in this macro. I've troubleshot it by using the following query (to keep it consistent, here is the 'design' view expression I tested rather than SQL):
Expr1: IIf(CDbl([__LiveVersionParser_Q].[DevelopmentVersion])
<=CDbl([__LocalVersionParser_Q].[DevelopmentVersion]),"OK","UPDATE")
Any suggestions? I feel like I'm missing something simple.