After Update of Form (1 Viewer)

H Pepper

Registered User.
Local time
Today, 22:35
Joined
Apr 18, 2002
Messages
13
I have an image of a 'tick' which I want to appear on my form to indicate that everything is ready for the next step. This appears when the user hits a button. If a user then amends antyhing on the form (which is not allowed as then it invalidates things) I want the tick to disappear so that the user can see at a glance that if the tick is not there, they have to hit the button again.

I assumed that I could place the following code on the After Update event on the Form:

me.tickimage.visible = false

as I thought this means that if anything is updated on the form then the tickimage will disappear. However, this does not work. I don't really want to put the code on the field events as there are so many fields on the form.

What am I doing wrong? Any ideas gratefully received.
 

WayneRyan

AWF VIP
Local time
Today, 22:35
Joined
Nov 19, 2002
Messages
7,122
H,

The following will restore everything when the user changes
anything after your validation.

Adapted from the help files:

Private Sub Form_Dirty()
MsgBox("Don't change anything while the tick mark is there.")
Dim ctlC As Control
' For each control.
For Each ctlC in Me.Controls
If ctlC.ControlType = acTextBox Then
' Restore Old Value.
ctlC.Value = ctlC.OldValue
End If
Next ctlC
End Sub

hth,
Wayne
 

Users who are viewing this thread

Top Bottom