I am trying to add some code to a button that prints a report. What I want to happen is to have the user click the print button and have the form print then have it automatically close all the open forms and leave just the switchboard open. My code isn’t working here it is. Think I am just naming the forms wrong.
Private Sub Command82_Click()
On Error GoTo Err_Command82_Click
Dim stDocName As String
stDocName = “Main Table”
DoCmd.OpenReport stDocName, acNormal
DoCmd.Close , Form![PSTP1]
DoCmd.Close , Form![PSTP2]
DoCmd.Close , Form![PSTP3]
Exit_Command82_Click:
Exit Sub
Err_Command82_Click:
MsgBox Err.Description
Resume Exit_Command82_Click
End Sub