P
PHisaw
I have a main form (fGeneralInfo) with control (JobNumber (auto number)).
There is a subform (fStatus) with control (SlspNotice (date field)). When
the date is filled in, on exit, a report is prompted to print asking for job
number. The report's underlying query asks for job number. Using the
following code, which doesn't work, is there a way to make the report print
reading the job number from the control on the main form without the dialog
box prompting for job number?
As always, any help is greatly appreciated!
Thanks, Phisaw
Private Sub SalesmanNotice_Exit(Cancel As Integer)
On Error GoTo Err_SalesmanNotice_Click
If [Forms]![fGeneralInformation]![CustomerName] = "Plaquemine" Then
MsgBox "Send Status From TempEmails to Slsp"
Else
Set Application.Printer = Application.Printers("CutePDF Writer")
DoCmd.OpenReport "rRepairAdvisement", , , "JobNumber=" &
[Forms]![fGeneralInformation]![JobNumber]
Set Application.Printer = Nothing
End If
Exit_SalesmanNotice_Click:
Exit Sub
Err_SalesmanNotice_Click:
MsgBox Err.Description
Resume Exit_SalesmanNotice_Click
End Sub
There is a subform (fStatus) with control (SlspNotice (date field)). When
the date is filled in, on exit, a report is prompted to print asking for job
number. The report's underlying query asks for job number. Using the
following code, which doesn't work, is there a way to make the report print
reading the job number from the control on the main form without the dialog
box prompting for job number?
As always, any help is greatly appreciated!
Thanks, Phisaw
Private Sub SalesmanNotice_Exit(Cancel As Integer)
On Error GoTo Err_SalesmanNotice_Click
If [Forms]![fGeneralInformation]![CustomerName] = "Plaquemine" Then
MsgBox "Send Status From TempEmails to Slsp"
Else
Set Application.Printer = Application.Printers("CutePDF Writer")
DoCmd.OpenReport "rRepairAdvisement", , , "JobNumber=" &
[Forms]![fGeneralInformation]![JobNumber]
Set Application.Printer = Nothing
End If
Exit_SalesmanNotice_Click:
Exit Sub
Err_SalesmanNotice_Click:
MsgBox Err.Description
Resume Exit_SalesmanNotice_Click
End Sub