Report not printing modified data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I have created a purchase order system. When the user creates a new
order and prints out the information, it works fine. However, when they go
in and modify an old order and try to print it out, it does not print out the
new information unless they close it and reopen it. Then it shows the new
data and they can print the report. Is there a way that when they click on
the print button it will save the changes and show that in the report they
are about to print? Thanks for your help!
 
You need to save the changes to the record before you print.

modifying your code to include something like this should do it...

Private Sub cmdPrint_Click()

If Me.Dirty Then 'Save any edits.

Me.Dirty = False

End If
 
Hello, I have created a purchase order system. When the user creates a new
order and prints out the information, it works fine. However, when they go
in and modify an old order and try to print it out, it does not print out the
new information unless they close it and reopen it. Then it shows the new
data and they can print the report. Is there a way that when they click on
the print button it will save the changes and show that in the report they
are about to print? Thanks for your help!

Access does not save new data until you navigate to another record,
close the form, or expressly tell it to save the data.

Code your print command button:

DoCmd.RunCommand acCmdSave
DoCmd.OpenReport "ReportName", acViewPreview
 
Back
Top