J
Jason W. Peak
I've got a AutoExec macro calling a function named CheckCommandLine.
All's well and good if I just throw a line in that function like
'DoCmd.OpenReport "rptForecastAtRepLevelDollars"'. It works on the
machine I'm developing on as well as the machine I'm deploying to.
Now here comes the problem. The second I throw in a line referencing
Command (should grab the command-line argument passed by /cmd per MS
docs), it works on my development machine but bombs on the target
machine. For example, I threw in the following test:
Function CheckCommandLine()
If Command <> "" Then
DoCmd.OpenReport "rptForecastAtRepLevelDollars", acViewPreview
Else
DoCmd.OpenReport "rptForecastAtCustLevelDollars",
acViewPreview
End If
End Function
As soon as this test against Command was put in, it bombed on the
client machine...still works on the development machine though. It
should run one of the two reports, regarless of whether anything is
passed in or not. It just gave the following error messages:
Action Failed
Macro Name: AutoExec
Condition: True
Action Name: RunCode
Arguments: CheckCommandLine
Execution of this application has stopped due to a run-time error.
The application can't continue and will be shut down.
Then it just exited Access when I hit ok. Removing everything but one
of the DoCmd lines (tested it with both singularly) results in the
correct report running in preview mode on the target machine.
All's well and good if I just throw a line in that function like
'DoCmd.OpenReport "rptForecastAtRepLevelDollars"'. It works on the
machine I'm developing on as well as the machine I'm deploying to.
Now here comes the problem. The second I throw in a line referencing
Command (should grab the command-line argument passed by /cmd per MS
docs), it works on my development machine but bombs on the target
machine. For example, I threw in the following test:
Function CheckCommandLine()
If Command <> "" Then
DoCmd.OpenReport "rptForecastAtRepLevelDollars", acViewPreview
Else
DoCmd.OpenReport "rptForecastAtCustLevelDollars",
acViewPreview
End If
End Function
As soon as this test against Command was put in, it bombed on the
client machine...still works on the development machine though. It
should run one of the two reports, regarless of whether anything is
passed in or not. It just gave the following error messages:
Action Failed
Macro Name: AutoExec
Condition: True
Action Name: RunCode
Arguments: CheckCommandLine
Execution of this application has stopped due to a run-time error.
The application can't continue and will be shut down.
Then it just exited Access when I hit ok. Removing everything but one
of the DoCmd lines (tested it with both singularly) results in the
correct report running in preview mode on the target machine.