I have three forms that I need to print using 1 button on the last form instead of a button on each form. What do I need to change in the code and/or where do I put the names of the other forms so that they print? Here is what I have so far:
Private Sub Print_Click()
On Error GoTo Err_Print_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "Index Performance Appraisal 1"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
Exit_Print_Click:
Exit Sub
Err_Print_Click:
MsgBox Err.Description
Resume Exit_Print_Click
End Sub
Private Sub Print_Click()
On Error GoTo Err_Print_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "Index Performance Appraisal 1"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
Exit_Print_Click:
Exit Sub
Err_Print_Click:
MsgBox Err.Description
Resume Exit_Print_Click
End Sub