Added field will not print

G

Guest

I have a report based on a form (Invoices). The report has been printing fine. I added a field to the form. When information is typed in, the table is updated fine, but the information will not print out on the report. I have a command button on the form that prints the current record as well as one to re-print (in case of paper jam). The field will print with the re-print button, but not the first command button. Following is my code
Private Sub bttnContinue_Click(
Dim retval As Lon

If Nz(Forms!frmInvoices!curBalance) > Forms!frmInvoices!curBalance And Forms!frmInvoices!booNew The
retval = MsgBox("This invoice will put customer over current credit limit. Do you wish to continue?", vbYesNo
If retval = vbNo The
Exit Su
End I
End I
If Forms!frmInvoices!booNew = True The
'MsgBox "Running post invoice queries
DoCmd.RunMacro "Post Invoice Queries
End I
retval = MsgBox("Print Invoice?", vbYesNoCancel
If retval = vbCancel The
DoCmd.RunMacro "Delete Current Invoice Queries
Els
If retval = vbYes The
Dim strDocName As Strin
Dim strFilter As Strin
strDocName = "rptInvoice
strFilter = "lngInvoiceId = Forms!frmInvoices!lngInvoiceID
DoCmd.OpenReport "rptInvoice", acViewNormal, , strFilte
End I
End I

End Su
What do I need to do to get it to print from here?
Thanks for your help!
 
F

fredg

I have a report based on a form (Invoices). The report has been printing fine. I added a field to the form. When information is typed in, the table is updated fine, but the information will not print out on the report. I have a command button on the form that prints the current record as well as one to re-print (in case of paper jam). The field will print with the re-print button, but not the first command button. Following is my code:
Private Sub bttnContinue_Click()
Dim retval As Long

If Nz(Forms!frmInvoices!curBalance) > Forms!frmInvoices!curBalance And Forms!frmInvoices!booNew Then
retval = MsgBox("This invoice will put customer over current credit limit. Do you wish to continue?", vbYesNo)
If retval = vbNo Then
Exit Sub
End If
End If
If Forms!frmInvoices!booNew = True Then
'MsgBox "Running post invoice queries"
DoCmd.RunMacro "Post Invoice Queries"
End If
retval = MsgBox("Print Invoice?", vbYesNoCancel)
If retval = vbCancel Then
DoCmd.RunMacro "Delete Current Invoice Queries"
Else
If retval = vbYes Then
Dim strDocName As String
Dim strFilter As String
strDocName = "rptInvoice"
strFilter = "lngInvoiceId = Forms!frmInvoices!lngInvoiceID"
DoCmd.OpenReport "rptInvoice", acViewNormal, , strFilter
End If
End If

End Sub
What do I need to do to get it to print from here?
Thanks for your help

I haven't waded through your code, but I suspect you are probably
trying to print the new record before you have saved it.

Private Sub bttnContinue_Click()
DoCmd.RunCommand acCmdSaveRecord
Dim retval As Long
etc.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top