Update underlying table

Hello, I tried to use my save button to trigger the DoCmd.Save method, which in-turn triggers a refresh to a control on another form. However, I can stay on that record and hit save all day and watch the control refresh and never change. It takes a move off the record and then another refresh to update the control that is connected direct to the table. Why is this? Should I be using Me. Dirty = Yes? to get this to do what I want (basically an instant update to the control on the other form, after a refresh)? Thank you.
 
Last edited:
DoCmd.Save does NOT save the current record.

Use.
Code:
If Me.Dirty Then
    DoCmd.RunCommand acCmdSaveRecord
End IF

OR

Code:
If Me.Dirty Then
    Me.Dirty = False            '' forces record to save
End If

If you have multiple forms open, it is best to make the second form a dialog so that control stays with it until you close it. Then control returns to the calling form. This allows you to refresh the first form when the second form closes.

Pat, thanks for the information. the Me.Dirty=False Property works great. the form I'm updating after the save record, is a Switchboard that has a dual function as a Dashboard, for a vehicle fleet status, and also the Main Menu to the other Forms. The status tracks Vehicle Mileages, Dead-lined or In-Commission, and Inspections Overdue or Soon to be do. So, Lots of updates going to the Dashboard as things get saved from other Forms. Therefore the update should happen as soon as the save button is hit, not when the Form closes. Thank you.
 

Users who are viewing this thread

Back
Top Bottom