P
Pele
I used the command button wizard to create a command button for printing a
form. The intention is for the user to click the command button on one form
(frm_Update Rate Table_MAIN) and that should print off the subform (a
continous form called Frm_Update Rate Table).
The problem is, the print button seems to be printing the Main form (showing
all the other buttons on the Main form) but I only want it to print the
continous subform (lines of records).
Belwo is the code the wizard wrote...can anybody help.
Pele
Private Sub Cmd_print_Update_rate_Click()
On Error GoTo Err_Cmd_print_Update_rate_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "Frm_Update Rate Table"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
Exit_Cmd_print_Update_rate_Click:
Exit Sub
Err_Cmd_print_Update_rate_Click:
MsgBox Err.Description
Resume Exit_Cmd_print_Update_rate_Click
End Sub
form. The intention is for the user to click the command button on one form
(frm_Update Rate Table_MAIN) and that should print off the subform (a
continous form called Frm_Update Rate Table).
The problem is, the print button seems to be printing the Main form (showing
all the other buttons on the Main form) but I only want it to print the
continous subform (lines of records).
Belwo is the code the wizard wrote...can anybody help.
Pele
Private Sub Cmd_print_Update_rate_Click()
On Error GoTo Err_Cmd_print_Update_rate_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "Frm_Update Rate Table"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
Exit_Cmd_print_Update_rate_Click:
Exit Sub
Err_Cmd_print_Update_rate_Click:
MsgBox Err.Description
Resume Exit_Cmd_print_Update_rate_Click
End Sub