Form BeforeUpdate event

wh00t

Registered User.
Local time
Today, 20:51
Joined
May 18, 2001
Messages
264
I have created a beforeupdate event for a form to ensure that data is correct, however, on the last control on the form I have the following after update event

HiddenControl = "Stuff"
DoCmd.GoToRecord , , acNewRec
myList.Requery

The problem I have is that when the beforeupdate event runs I would like to cancel the afterupdate code if the beforeupdate shows cancel=true.

I believe that the beforeupdate is running between the first 2 lines of my afterupdate code.

Any way of doing this or do I have to insert the same checks in the afterupdate event?
 
Why not include

HiddenControl = "Stuff"
DoCmd.GoToRecord , , acNewRec
myList.Requery

in the beforeupdate event?

If validation fails Then

cancel=true

Else

HiddenControl = "Stuff"
DoCmd.GoToRecord , , acNewRec
myList.Requery

End If

Linq
 
Thanks, sometimes I look to hard and miss the right way :}
 

Users who are viewing this thread

Back
Top Bottom