Include the path to msaccess.exe in the shortcut, e.g.:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
"S:\admin\excel queries.mdb" /cmd auto
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Mike B in VT" <(E-Mail Removed)> wrote in message
news:48815436-C6BF-4436-87C5-(E-Mail Removed)...
> I'm trying to use the Command function to pass a paramter into Access and
> it
> isn't working. If the parameter is "auto" I want to call a macro to print
> a
> bunch of reports, otherwise I want to display a form.
>
> The Icon is setup as "S:\admin\excel queries.mdb" /cmd "auto"
>
> I have in the only module, and have the AutoExec Macro call it:
>
> Public Function CheckCommandLine()
>
> ' Check the value returned by Command function and display
> ' the appropriate form.
>
> MsgBox Command() ' for debug purposes
>
> If Command = "auto" Then
> DoCmd.RunMacro "mcrPrintReports1"
> Else
> DoCmd.OpenForm "Form1"
> End If
>
> End Function
>
> But the msgbox shows up empty and it always just runs the form.
> Help!