Chapter 10: VBA Programming Fundamentals
415
Before the Command-Line Arguments option was available, there was no easy way to test the
effect of command-line arguments in your application. Use this option to test and debug the com-
mand-line argument code you build into your applications.
FIGURE 10.23
Adding a command-line argument to a shortcut pointing to a Windows application
Caution
Don’t forget to remove the text from this option before distributing your application to end users. The text you
enter in this option setting is persistent and will remain there until it’s removed or changed.
On the CD-ROM
Use the Command function to return the arguments portion of the command line used to start Access or the
Access runtime environment. The Chapter10.accdb example database includes frmCommandLine (see
Figure 10.24), a demonstration of the Command function. Use the Options dialog box to set some command-
line arguments for Chapter10.accdb; then click on the button on frmCommandLine to see how the
Command function retrieves the arguments.