Is it possible to change the condition of a Macro with VBA? I would like to append a field to a table with a function which is called from the autoexec macro. But this Function should be called only once.
How about converting you Autoexec Macro to a vb Function using the build in conversion (Tools, Options, Convert...). Then Make another Autoexec Macro which has just a runcode command to run the Function you just created. This was you can get more control over things. Then put an IF staement into the code you are trying to run only once. Make the IF statement perform a test on the contects of a table (eg DlookUp(...the entry in the table = a specific thing). If the contents do = this specific thing, make the code run an update query on the table so the contents become something different. This way, on first run, the table entry changes and the code will therefore never run again.
Its a bit of a lumpy solution bit I know it works. I've used it before with a Autoexec macro to keep on showing a form (which the user has to press OK or Cancel to Accept licence conditions). Pressing Cancel shuts down the database, pressing OK causes the table to be updated and the code never run again.
Hope this helps, jobo123
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.