Form.Dirty is false when it should be true

I notice that in one of my forms (limited by request) when I do this code:

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

A true value should appear because this is an onDirty event, right? But actually I get a "lie". Why?

+6
source share
1 answer

This is because a dirty event is where you can undo a change and discard it. After a dirty event, the form actually becomes marked as dirty. For example, the event chain for a text field is

KeyDown> KeyPress> BeforeInsert> Dirty> KeyUp

Hope this helps

+7
source

Source: https://habr.com/ru/post/888992/


All Articles