P
Pam
Hi,
I have a main form (fGeneralInformation) with a subform (fStatus). On the
subform, there is a field (Incoming). When the date is entered into this
field, it should print a report based on the JobNumber field on the main
form. I was doing this with a macro and it would ask for the job number
before printing. I have been using code more and thought I would change
this to auto print without the additional job number prompt. It was working
fine for a while, but for some reason now only prints blank pages. I'm
hoping someone will take a look and tell me what could possibly be the
problem. Any help is greatly appreciated! Thanks in advance!! Pam
Private Sub Incoming_AfterUpdate()
On Error GoTo Err_Incoming_AfterUpdate
If [Forms]![fGeneralInformation]![CustomerName] = "Lyondell" Then
DoCmd.OpenReport "rRMABatchRegularLyondell", , , "JobNumber=" &
[Forms]![fGeneralInformation]![JobNumber]
Else
DoCmd.OpenReport "rRMABatchRegular", , , "JobNumber=" &
[Forms]![fGeneralInformation]![JobNumber]
End If
Exit_Incoming_AfterUpdate:
Exit Sub
Err_Incoming_AfterUpdate:
MsgBox Err.Description
Resume Exit_Incoming_AfterUpdate
End Sub
I have a main form (fGeneralInformation) with a subform (fStatus). On the
subform, there is a field (Incoming). When the date is entered into this
field, it should print a report based on the JobNumber field on the main
form. I was doing this with a macro and it would ask for the job number
before printing. I have been using code more and thought I would change
this to auto print without the additional job number prompt. It was working
fine for a while, but for some reason now only prints blank pages. I'm
hoping someone will take a look and tell me what could possibly be the
problem. Any help is greatly appreciated! Thanks in advance!! Pam
Private Sub Incoming_AfterUpdate()
On Error GoTo Err_Incoming_AfterUpdate
If [Forms]![fGeneralInformation]![CustomerName] = "Lyondell" Then
DoCmd.OpenReport "rRMABatchRegularLyondell", , , "JobNumber=" &
[Forms]![fGeneralInformation]![JobNumber]
Else
DoCmd.OpenReport "rRMABatchRegular", , , "JobNumber=" &
[Forms]![fGeneralInformation]![JobNumber]
End If
Exit_Incoming_AfterUpdate:
Exit Sub
Err_Incoming_AfterUpdate:
MsgBox Err.Description
Resume Exit_Incoming_AfterUpdate
End Sub