P
PeterM
I have a form in AC2003. On that form there is a text control for a person's
weight. I have two small buttons just to the right of the text control. One
is an up button and the other is a down button. For the up button:
Private Sub cmdUpCbo_Click()
Me.GM_Weight = Me.GM_Weight + 1
End Sub
and for the down button:
Private Sub cmdDownCbo_Click()
Me.GM_Weight = Me.GM_Weight - 1
End Sub
The following is the code for the dirty event:
Private Sub Form_Dirty(Cancel As Integer)
Me.btnUndo.Enabled = True
Me.btnNew.Enabled = False
Me.btnSave.Enabled = True
Me.btnDelete.Enabled = False
TurnNavigationButtonsOff
End Sub
The problem is that if I go to the weight control and change the value
directly, the onDirty event fires, however, if I touch either the up or down
button, the value in the weight control does what I expect but the onDirty
event does not fire.
To debug this I set the RecordSelectors to Yes and ran the exact same test
with the same exact code. The record selector changes to the pencil if I
change the weight control directly or if I use the up or down buttons.
Why doesn't the onDirty event fire when I use the buttons?
Thanks for your help!
weight. I have two small buttons just to the right of the text control. One
is an up button and the other is a down button. For the up button:
Private Sub cmdUpCbo_Click()
Me.GM_Weight = Me.GM_Weight + 1
End Sub
and for the down button:
Private Sub cmdDownCbo_Click()
Me.GM_Weight = Me.GM_Weight - 1
End Sub
The following is the code for the dirty event:
Private Sub Form_Dirty(Cancel As Integer)
Me.btnUndo.Enabled = True
Me.btnNew.Enabled = False
Me.btnSave.Enabled = True
Me.btnDelete.Enabled = False
TurnNavigationButtonsOff
End Sub
The problem is that if I go to the weight control and change the value
directly, the onDirty event fires, however, if I touch either the up or down
button, the value in the weight control does what I expect but the onDirty
event does not fire.
To debug this I set the RecordSelectors to Yes and ran the exact same test
with the same exact code. The record selector changes to the pencil if I
change the weight control directly or if I use the up or down buttons.
Why doesn't the onDirty event fire when I use the buttons?
Thanks for your help!