Printing wrong data on form

knoppix

Registered User.
Local time
Today, 02:46
Joined
Aug 26, 2004
Messages
10
Hi. I have a form for a database of about 800 entries. once the form is filled i need to print it off. I have had no problems until now. But for some reason it prints off the data for the previous entry, not the data that was just entered. It is like what i just entered does not exist. If i close the form and reopen it everything is the way it should be and I can print my last entry. I have tried the save record option in the record menu before printing but does not change anything.
 
Are you trying to print the current record? If so, paste this code below.

On Error GoTo Err_Command2_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click


Or make a command wizard button for print record.

Michael
 
Forms are not designed to be printed, the DoMenuItem is obsolete and DoCmd.PrintOut is buggy.
Use a Report after saving the record first with
DoCmd.RunCommand acCmdSaveRecord
 
I have tried your suggestion, but it still prints the previous data. If the new data has the id number 6, after you press the print button, the data including id number changes to that of 5. then number of records says that there are 6 records and on page 6 of 6 but the displayed data is that of 5. record 6's data can not be displayed until the form is closed and reopened.

If you have any other suggestions then great, i will try them.

If not, well thanks for trying.
 

Users who are viewing this thread

Back
Top Bottom