S
Sandy
I have two buttons on my form running these two macros
"Private Sub cmdPrint_Job_Sheet_Click()
On Error GoTo Err_cmdPrint_Job_Sheet_Click
Dim stDocNameCustomer, stDocNameWorkshop As String
stDocNameCustomer = "rpt_Single_Record_Customer"
DoCmd.OpenReport stDocNameCustomer, acNormal
stDocNameWorkshop = "rpt_Single_Record_Workshop"
DoCmd.OpenReport stDocNameWorkshop, acNormal
Exit_cmdPrint_Job_Sheet_Click:
Exit Sub
Err_cmdPrint_Job_Sheet_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Job_Sheet_Click
End Sub"
"Private Sub CloseForm_Click()
On Error GoTo Err_CloseForm_Click
DoCmd.Close
Exit_CloseForm_Click:
Exit Sub
Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
End Sub"
I would like to combine them onto one button but I can't get my head round
the Error and Exit sub parts of it and where they should all be positioned.
Guidance would be very welcome.
Sandy
"Private Sub cmdPrint_Job_Sheet_Click()
On Error GoTo Err_cmdPrint_Job_Sheet_Click
Dim stDocNameCustomer, stDocNameWorkshop As String
stDocNameCustomer = "rpt_Single_Record_Customer"
DoCmd.OpenReport stDocNameCustomer, acNormal
stDocNameWorkshop = "rpt_Single_Record_Workshop"
DoCmd.OpenReport stDocNameWorkshop, acNormal
Exit_cmdPrint_Job_Sheet_Click:
Exit Sub
Err_cmdPrint_Job_Sheet_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Job_Sheet_Click
End Sub"
"Private Sub CloseForm_Click()
On Error GoTo Err_CloseForm_Click
DoCmd.Close
Exit_CloseForm_Click:
Exit Sub
Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
End Sub"
I would like to combine them onto one button but I can't get my head round
the Error and Exit sub parts of it and where they should all be positioned.
Guidance would be very welcome.
Sandy