Autoexec and close the database (1 Viewer)

DevAccess

Registered User.
Local time
Today, 14:58
Joined
Jun 27, 2016
Messages
321
Hello

I am running some function from autoexec macro using run code command and specify function name of vba, now this runs on scheduled activity I would like to close the database when program finishes with the activity.

I tried in vba, application.quit but it does not work and gives me error saying it is not available now.

Please assist.
 

Ranman256

Well-known member
Local time
Today, 17:58
Joined
Apr 9, 2015
Messages
4,337
application.quit does work...but you dont need it in the function,
put it in the autoexec AFTER your function.

i use it all the time.
 

DevAccess

Registered User.
Local time
Today, 14:58
Joined
Jun 27, 2016
Messages
321
application.quit does work...but you dont need it in the function,
put it in the autoexec AFTER your function.

i use it all the time.

You mean to say that I need to create function B and have there application.quite and shall I call function B after function A in autoexec ?
 

isladogs

MVP / VIP
Local time
Today, 22:58
Joined
Jan 14, 2017
Messages
18,216
No. Just use the macro command Quit Access
 

Users who are viewing this thread

Top Bottom