Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Form.Dirty is false when it should be true

Tags:

vba

ms-access

I notice that in one of my form(bounded to a query), when I do this code:

Private Sub Form_Dirty(Cancel As Integer)
    MsgBox Me.Form.Dirty
End Sub

It should pop up the value 'true', because this is onDirty event, right? But actually i get a 'false'. Why?

like image 201
darkjh Avatar asked May 25 '11 09:05

darkjh


1 Answers

That’s because the dirty event is where you can cancel the change and roll it back. It is after the dirty event that the form actually gets marked as dirty. The chain of events for a text box for example is this

KeyDown > KeyPress > BeforeInsert > Dirty > KeyUp

Hope this helps

like image 122
Kevin Ross Avatar answered Sep 28 '22 02:09

Kevin Ross