Save Button On Form

adams.bria

Registered User.
Local time
Yesterday, 19:23
Joined
Apr 28, 2010
Messages
41
Form is used to "check" out customers from an auction. Field "payment method" is selected on form, and report "receipt" is printed. For some reason payment method does not update instantly after selection, and requires me to basically go from one customer and then back and then when I click receipt the payment method will populate on the report. So I am think I need a "Save" button so that the form/table refresh themselves. Any help/ideas?
 
That would be the easiest way -

Put in this code:

If Me.Dirty Then Me.Dirty = False

to save if there are changes to save. If not are there then it won't attempt a save.
 
So what I am wondering is if I can just add "DoCmd.Save" before the DoCmd that opens the report. Is this possible, and would I have to do anything other than simply putting DoCmd.Save?

Here is what I have right now for the receipt button




Private Sub Open_Receipt_Click()
On Error GoTo Open_Receipt_Click_Err

DoCmd.OpenReport "Receipt", acPreview, "", "[Receipt Filter]!AttNumber=Forms![Update Attendee Payment]![AttNumber]", acNormal


Open_Receipt_Click_Exit:
Exit Sub

Open_Receipt_Click_Err:
MsgBox Error$
Resume Open_Receipt_Click_Exit

End Sub
 
Should have dug a little deeper before posting. For anyone else who is wondering, here is the code that should be before the open report do command


DoCmd.RunCommand acCmdSaveRecord
 
Bob's

If Me.Dirty Then Me.Dirty = False

as well as

DoCmd.RunCommand acCmdSaveRecord

will both work in this situation. Most old hands prefer the former, as do I. Being advanced in years, I find it easier to remember than the latter! And once again, of course, my 'signature' statement is prove true! :D

Linq ;0)>
 
Should have dug a little deeper before posting. For anyone else who is wondering, here is the code that should be before the open report do command


DoCmd.RunCommand acCmdSaveRecord

I would suggest NOT using

DoCmd.RunCommand acCmdSaveRecord

but instead use what I suggested and what Linq suggested:

If Me.Dirty Then Me.Dirty = False

as that will attempt a save ONLY if there is something to save. The other will attempt a save regardless.
 

Users who are viewing this thread

Back
Top Bottom