Background:
I have an Access 2010 database that is going to be run automatically once per day.
All of the programming for the database is a VBA Sub named ETL.
The plan is to to start the database using a line similar to the following:
“C:Program Files (x86)Microsoft OfficeOffice14MSACCESS.EXE” “U:CI.accdb” /X macRunETL
macRunETL has 1 action: RunCode RunETL().
RunETL() only has 1 purpose, to call the Sub ETL.
The above works fine.
The problem is trying to close CI.accdb and exit Access after the procedure ends.
When I try to add the macro action QuitAccess the Unsafe Action icon is displayed and the ‘The command or action isn’t available now.’ error message appears when the macro runs.
I tried adding Application.Quit acQuitSaveNone to a function and having the macro call this function, but receive Runtime error 2046 with the same error message. (This function works if I manually execute it from the Visual Basic Editor, although Task Manager still shows the MSACCESS process running even though the Access application is not.)
The database is saved in a trusted location and the Trust Center Macro Settings = Enable All Macros.
All of my other databases have Main Menu forms with a exit button that works.
This is my first non-user interaction database and I don’t know what else to try.:confused:
Thanks,