Help with After Update?

gnarpeggio

Registered User.
Local time
Today, 09:00
Joined
Jun 22, 2010
Messages
74
Hello again,

I'm trying to get a button to function while the current record is open and apply all the changes made to the record when it is printed.

I have a form where users can enter an invoice for each copy job they complete. My problem is having the "Print Invoice" button actually apply the information to the report when it is printed. I'm aware that if you lose the focus of the current record and then return to it, the information will appear on the report as the record has been updated and saved.

But, can you print the newly entered information without moving onto the next record? Hmmm...

Any help on this is appreciated!
 
You can use

DoCmd.RunCommand acCmdSaveRecord
or
If Me.Dirty Then Me.Dirty = False
 
Should I apply this to the button's OnClick event, or to the form's After Update event?

Currently, I have code set up on my "Print Invoice" button that specifies to print only the current invoice:

DoCmd.OpenReport "InHouse", acViewNormal, , "[JobNo] = " & Forms!InHouseForm.JobNo

If I add the code you mentioned above, how would I get it to work in conjunction with event already present in the button's OnClick procedure?
 
After messing around with a few expressions, I've figured this method out. I didn't think to add it to the OnClick above the initial function (As I thought that you could only assign one "DoCmd" action to each sub).

So much to learn...

Thanks again!
 
Glad you got it sorted out. I would have said the click event; the after update event wouldn't help as the data will have been saved at that point anyway.
 

Users who are viewing this thread

Back
Top Bottom