Save -> Refresh -> Print

m82palmer

New member
Local time
Today, 02:30
Joined
Apr 16, 2004
Messages
9
I have a data Entry form that enters information into many different tables. This works fine.

To save and exit the form I have a save button with the following code connected onClick:
Code:
MsgBox "Please Collect The Print Out"
DoCmd.Close
DoCmd.OpenForm ("Main Menu")

This saves the data that has been entered on the form, closes it and takes the user back the main menu.



I have a Query that looks up the last added relevant information from the different tables, in order to compile a report. This also works fine.


However when I get the report to automatically print out when they save the data
Code:
MsgBox "Please Collect The Print Out"
DoCmd.Close
DoCmd.OpenForm ("Main Menu")
[i]DoCmd.OpenReport ("Book Out Print Out")[/i]

The information it prints out however is from the previous input. (IE I have entered the information for ID = 5 but it prints out the data for ID = 4) However if I then load up the report manually it shows the correct data.

Therefore I’m assuming that I need to save the data, and get the form to refesh the database in order to get the correct information. Anyone got any brain waves on how i would do this?

Cheers

Michael
 
try with the ommand line "DoCmd.RunCommand acCmdSaveRecord"

To save and exit the form I have a save button with the following code connected onClick:
Code:
MsgBox "Please Collect The Print Out"
DoCmd.Close
DoCmd.OpenForm ("Main Menu")

This saves the data that has been entered on the form, closes it and takes the user back the main menu.



I have a Query that looks up the last added relevant information from the different tables, in order to compile a report. This also works fine.


However when I get the report to automatically print out when they save the data
Code:
MsgBox "Please Collect The Print Out"
DoCmd.Close
DoCmd.OpenForm ("Main Menu")
[COLOR=DarkOrange]DoCmd.RunCommand acCmdSaveRecord[/COLOR]
[i]DoCmd.OpenReport ("Book Out Print Out")[/i]

The information it prints out however is from the previous input. (IE I have entered the information for ID = 5 but it prints out the data for ID = 4) However if I then load up the report manually it shows the correct data.

Therefore I’m assuming that I need to save the data, and get the form to refesh the database in order to get the correct information. Anyone got any brain waves on how i would do this?

Cheers

Michael[/QUOTE]
 
lol thankyou

im laughing at my own stupidity :D by all means join in :D

Cheers
 

Users who are viewing this thread

Back
Top Bottom