Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updated a record in a form but it didn't show it in a printed report

Status
Not open for further replies.

banco

Technical User
Jul 9, 2002
11
US
Hello guys,

I have a form with a button that prints a report with the information of the form. The thing is that as I update the info in the form and print the report it prints the old info. (before update) I had to advance to the next record and come back and print to print the updated information.
What do I need to do to print the updated info right there w/o going to the next record and then coming back to print.

Thanks for any input...

 
Add the following line to the code behind the button, before the code which produces the report:

Docmd.RunCommand acSaveRecord

If you're unsure how to do this, from Design View, use the View, Code options, add the change, then File, Save, then File, Close and Return to Access.

This should solve the problem,
Cheers,

Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
 
Please note correction to the above post. The line of code should read:

Docmd.RunCommand acCmdSaveRecord

As it stands in the prior post, the compact database command will occur, and cause lots of confusion. Sorry about that.
Cheers,

Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top