N
Nick
I have a button on a form. When I click the button it
opens a report. What I would like to do is close the form
after the report has opened. I used the code below but the
form won't close.
Can any one help?
Nick
Private Sub cmdNo_Click()
On Error GoTo Err_cmdNo_Click
Dim stDocName As String
stDocName = "SelectedLabels"
DoCmd.OpenReport stDocName, acPreview
Exit_cmdNo_Click:
Exit Sub
Err_cmdNo_Click:
MsgBox Err.Description
Resume Exit_cmdNo_Click
DoCmd.Close
End Sub
opens a report. What I would like to do is close the form
after the report has opened. I used the code below but the
form won't close.
Can any one help?
Nick
Private Sub cmdNo_Click()
On Error GoTo Err_cmdNo_Click
Dim stDocName As String
stDocName = "SelectedLabels"
DoCmd.OpenReport stDocName, acPreview
Exit_cmdNo_Click:
Exit Sub
Err_cmdNo_Click:
MsgBox Err.Description
Resume Exit_cmdNo_Click
DoCmd.Close
End Sub