Greetings all.
I have a main form and a subform.
On the mainform, when a user enters data, the "Save Record and Return" Button has the typical code:
If Me.Dirty = True Then
If MsgBox(" Save Changes? ", vbYesNo) = vbYes Then
Me.Dirty = False
Else
Me.Undo
End If
End If
This works fine if data is only entered in the main form. When data is subsequently entered in the subform, the "Save Changes" message box no longer appears,
and the user is returned to the previous form. It seems like the record is saved, but there is no option not to save (if info was entered in error).
I've tried and researched various work arounds but have yet to come up with a solution.
What I'm trying to achieve is:
1) The user enters data in the main form, then saves the record, and gets the option to save or not to save.
2) He/She then enters data in the subform, and once again gets the option to save, or not save the subform data.
3) Then he/she gets returned to the previous form.
Maybe there's a different/better way to approach this problem?
As always thanks in advance for any input.
I have a main form and a subform.
On the mainform, when a user enters data, the "Save Record and Return" Button has the typical code:
If Me.Dirty = True Then
If MsgBox(" Save Changes? ", vbYesNo) = vbYes Then
Me.Dirty = False
Else
Me.Undo
End If
End If
This works fine if data is only entered in the main form. When data is subsequently entered in the subform, the "Save Changes" message box no longer appears,
and the user is returned to the previous form. It seems like the record is saved, but there is no option not to save (if info was entered in error).
I've tried and researched various work arounds but have yet to come up with a solution.
What I'm trying to achieve is:
1) The user enters data in the main form, then saves the record, and gets the option to save or not to save.
2) He/She then enters data in the subform, and once again gets the option to save, or not save the subform data.
3) Then he/she gets returned to the previous form.
Maybe there's a different/better way to approach this problem?
As always thanks in advance for any input.