Hi,
I have been working on this for few days but I dont seem to figure out what I am doing wrong and why I cant get it to work.
When the user opens the report (rptSchedule) a form (frmPrintEmailPopup) is opened infront of the report. The form has 3 buttons: Email (works with no issues), Print (Works with default printer) and Close.
I want to allow users when they press the "Print" button to get the chnage printer dialogue box to change the printer. Currently the report is setup to print from my desk printer. For security and disabled the right mouse click in the database.
Below is the code I have on the event: On Click of the frmPrintEmailPopup.
Below is the code I have on the event: On Click of the rptSchedule.
Currently with the above when the report is opened and the "Print" button is clicked on the frmPrintEmailPopup form the printer change dialogue box is opened but it prints only the image of the form and the report prints on my desk printer.
I will appreciate if someone could look at what I have and tell me what I am doing wrong or how to correct it
Thanks in advance
RB
I have been working on this for few days but I dont seem to figure out what I am doing wrong and why I cant get it to work.
When the user opens the report (rptSchedule) a form (frmPrintEmailPopup) is opened infront of the report. The form has 3 buttons: Email (works with no issues), Print (Works with default printer) and Close.
I want to allow users when they press the "Print" button to get the chnage printer dialogue box to change the printer. Currently the report is setup to print from my desk printer. For security and disabled the right mouse click in the database.
Below is the code I have on the event: On Click of the frmPrintEmailPopup.
Code:
Private Sub Print_Click()
On Error GoTo Err_Print_Click
'Opens print dialog for current screen:
DoCmd.RunCommand acCmdPrint
DoCmd.OpenReport Me.reportName
MsgBox "Print Complete"
Exit_Print_Click:
Exit Sub
Err_Print_Click:
' If action was cancelled by the user, don't display an error message.
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_Print_Click
Else
MsgBox Err.Description
Resume Exit_Print_Click
End If
End Sub
Below is the code I have on the event: On Click of the rptSchedule.
Code:
Option Compare Database
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmPrintEmailPopup"
Forms!frmPrintEmailPopup!reportName = Me.Report.Name
End Sub
Currently with the above when the report is opened and the "Print" button is clicked on the frmPrintEmailPopup form the printer change dialogue box is opened but it prints only the image of the form and the report prints on my desk printer.
I will appreciate if someone could look at what I have and tell me what I am doing wrong or how to correct it
Thanks in advance
RB