Autoexec Script Uses
by Steve Workings

If you create a Global Script called “Autoexec”, it will be played back automatically when you open the database. The “Autoexec” script is very useful for setting up your application. For example, you might want to hide the control panel, set up some global variables, and show the “Main Menu” form when a user loads a particular database. You could do this by creating an “Autoexec” script with these commands:

:controlpanel.hide()
:form.view( “menu_main” )
Of course if you hide the control panel, keep in mind that you may need it back. Make sure you’ve provided a button or other control with this line in it:
:controlpanel.show()
(Hint: A transparent button with password protection helps keep regular users out.)

Note: The Autoexec will be ‘bypassed’ if the user holds down the Shift key when the database is opened. This can be useful during testing of your Autoexec script, especially if it’s misbehaving. Keep in mind that the user may do the same thing after you distribute the application. If you use the Autoexec to open your Menu_main form and the user holds down the Shift key, the user will wind up looking at the control panel and could do a lot of damage to your application. Many recommend that you auto-load the initial startup form instead of calling it from the Autoexec script for this very reason. The Autoexec script can still be used to set certain global variables and it is necessary for such things as running the Automated Network Optimize described in the Code Archive.