To open a report using a button on a form i use the following code:
Private Sub Command47_Click()
On Error GoTo Err_Command47_Click
Dim stDocName As String
stDocName = "rpt_PlantProfiles"
DoCmd.OpenReport stDocName, acPreview
Exit_Command47_Click:
Exit Sub
Err_Command47_Click:
MsgBox Err.Description
Resume Exit_Command47_Click
End Sub
_____________________________________
I am trying to make a button on the same form that when clicked on it will close the report if it is open.
I sure could use some help on the code.
Many thanks!
Private Sub Command47_Click()
On Error GoTo Err_Command47_Click
Dim stDocName As String
stDocName = "rpt_PlantProfiles"
DoCmd.OpenReport stDocName, acPreview
Exit_Command47_Click:
Exit Sub
Err_Command47_Click:
MsgBox Err.Description
Resume Exit_Command47_Click
End Sub
_____________________________________
I am trying to make a button on the same form that when clicked on it will close the report if it is open.
I sure could use some help on the code.
Many thanks!