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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

information from form will not print

Status
Not open for further replies.

DBritter

Technical User
Joined
Jun 28, 2000
Messages
37
Location
US
I have a form with a command button that prints a report based on the information in that form. It is actually set up to run the report off of a query that is based on an ID number on the form.
When I go to a past record and back to the current record, it will print. I put a requery function onto the code but it does not make any difference.
I need to be able to fill out the form and then print it immediatly by clicking the command button.
thanks in advanced.
 
The problem lies in the fact the the record is probably not being saved before you try to print it. Even though all the info is there before you, the record doesn't really exist in the table, so your report shows a empty page. Add the following to the code that runs the report just before the line that actually opens the report:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord
 
No if you're using Access 97, DoMenuItem won't work, instead use:

DoCmd.RunCommand acCmdSaveRecord
 
Access 2000 is the same as 97. (DoCmd.RunCommand acCmdSaveRecord) Thanks CFRC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top