msg box with sub forms

D

Danny

I have a 3 forms, a main form, a subform to the main form and a
subform related (I believe referred to as nested or sub sub form) to
that subform. Gosh I hope this makes sense.
(form 1 is main form 2 is subform of 1 and form 3 is a subform of 2)

I have put the following code on the before update properties event in
the main form and also tried to put this in the sub form and the sub
sub form.

Private Sub Form_BeforeUpdate(Cancel As Integer)

If MsgBox("Data Has Changed - Do You Want to Update this Record", _
vbQuestion + vbYesNo) = vbNo Then
MsgBox "Record Not Updated"
Cancel = True
Me.Undo
End If
Exit_Add_or_Update_Click:
Exit Sub

Err_Add_or_Update_Click:
MsgBox Err.Description
Resume Exit_Add_or_Update_Click
End Sub
What I would like this to do is if the user updates any data in any of
the forms/subforms then ask the question one time, versus 3 times per
each form/subforms.

Does anyone have any ideas? or if you need more information please
advise

Thanks
 
A

Allen Browne

No, that's not practical.

Access saves the main form record before you move the cursor into the
subform. Since you have not started entering the subform record when the
main form record is saved, there is no way to validate them both at once.
 
D

Danny

No, that's not practical.

Access saves the main form record before you move the cursor into the
subform. Since you have not started entering the subform record when the
main form record is saved, there is no way to validate them both at once.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html











- Show quoted text -

Thanks that is what I was afraid of. I appreciate your response and
help. I really love this group it has always helped me. I could have
spent hours trying to figure this out. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top