Docmd.Requery

Vav

Registered User.
Local time
Today, 15:01
Joined
Aug 29, 2002
Messages
36
Hi there...

Quick question, I have a small qlitch on a form that i have developed. It is an order form and on that order form i have a "Print Order Form" command button. I found that once i have entered the information in the form and hit print, it does not print all the information, unless i get out of the form and get back in or switch to another record and then switch back to the record i want to print. I guess by doing this it sends the info to the table and then back to the form.

What i did to fix the problem was to insert a docmd.requery code in the before the print function. This works fine and all the info gets printed, however the requery code causes the form to reset and the first order form record appears.

What i want is a peice of code that will requery the form but leave it at the last record that i was working on. Either that or a suggestion on what other thing can i do rather than use the requery code to make sure that the data has been sent to the table.

thanks.......
 
You don't need to requery the form. The proper way to save a record is with:

DoCmd.RunCommand acCmdSaveRecord

The reason that the current record would not appear on your report is that it was not saved. The report pulls its data from the table directly or via a query. The data does not come from the form. Requery saves the current record as a by-product but as you have seen has undesirable side-effects.
 
Thanks

Thanks Pat....

That was a much better idea than doing the requery.

Peter Vav
 

Users who are viewing this thread

Back
Top Bottom