Before_Update event ( sub-form ) ?

liamfitz

Registered User.
Local time
Today, 20:24
Joined
May 17, 2012
Messages
240
I have a Cancel = True which triggers correctly, on a condition in the Before_Update event of a data field/control on a sub-form. However, the data which would have changed ( but won't now ) remains in the text box/control, and Focus stays on it. Only by closing and re-opening the form, can you 'refresh' the unchanged data ?? Any suggestions.:confused:
 
Use the Undo method. Example;

Code:
Private Sub YourControl_BeforeUpdate (Cancel As Integer)

'some condition is not met
Cancel = True
Me.YourControl.Undo

End Sub
 
That works perfectly Beetle. Thank you very much.
 

Users who are viewing this thread

Back
Top Bottom