G
Guest
Hi,
Below is my code in a module to run reports from a switchboard button. When
I try to run the reports, I get "There was an error executing the command"
error.
What am I doing wrong? TIA. Allan
Sub PrintAssignments()
On Error GoTo Err_PrintAssignments
Dim stDocName As String
Dim i As Integer
i = 1
Do Until i = 16
stDocName = "rptVA" & i
DoCmd.OpenReport stDocName, acNormal
i = i + 1
Loop
Exit Sub
Exit_PrintAssignments:
Exit Sub
Err_PrintAssignments:
MsgBox Err.Description
Resume Exit_PrintAssignments
End Sub
Below is my code in a module to run reports from a switchboard button. When
I try to run the reports, I get "There was an error executing the command"
error.
What am I doing wrong? TIA. Allan
Sub PrintAssignments()
On Error GoTo Err_PrintAssignments
Dim stDocName As String
Dim i As Integer
i = 1
Do Until i = 16
stDocName = "rptVA" & i
DoCmd.OpenReport stDocName, acNormal
i = i + 1
Loop
Exit Sub
Exit_PrintAssignments:
Exit Sub
Err_PrintAssignments:
MsgBox Err.Description
Resume Exit_PrintAssignments
End Sub