Saving Record and printing at same time

ElmoScheffer

New member
Local time
Today, 20:16
Joined
Oct 9, 2008
Messages
4
Hi,

Hope someone can point me in the right direction.

I have a form that gathers information and some of the information is entered manually. There are combo boxes, text boxes, calculated fields and so on. At the end of the process, the information is stored in a table.

I have a save button that saves the record and brings up a new blank form. I also have a report that needs to be printed after the form data is saved.

I would idealy like this action to be one, in other words, have a button that saves the record and prints the report all in one go.

I have a query that the reports runs off.
If I can do this I would also like to print the record that was just added. I have a text box on the form with a ID.

How do I do this????

Thanks very much

Elmo
 
I had a similar problem and boblarson helped me with this.
If Me.Dirty Then Me.Dirty = False
Bob says "It basically says If the form is dirty (changes have been made to one or more bound controls) then change it back to clean (which forces a save of the record)".
You could try putting it just above the print line in your code.
 
I prefer code that doesn't need to be interpreted. The first time I saw the "If Me.Dirty then Me.Dirty = False" expression, I thought the save was being cancelled. I have read the reason why this technique supposed to be better but I'll take my chances.

Code:
If Me.Dirty Then
   DoCmd.RunCommand accmdSaveRecord
End If
 

Users who are viewing this thread

Back
Top Bottom