Re: Is Dirty OR Is Not Dirty?



Baz,

Here is the code in my Combo Box's AfterUpdate:

Private Sub txtEmployeeID_AfterUpdate()

'Setup for errortrapping
On Error GoTo Err_txtEmployeeID_AfterUpdate

'Requery the form to display the most recent data
Me.Requery

'Setup the link field between the main form and the subform
Me.txtTSEmployeeID = Me.txtEmployeeID.Column(1)

'Requery the subform
Me.sfmFullTime***.Form.Requery

'If the record has not been submitted,move the focus to the
dateworked field
If Me.chkSubmitted <> -1 Then
txtDateWorked.SetFocus
End If

Exit_txtEmployeeID_AfterUpdate:

'Exit the AfterUpdate procedure
Exit Sub

Err_txtEmployeeID_AfterUpdate:

'An error has occured, so record it
Call LogError(Err.Number, Err.Description,
"frmUATTime***.txtEmployeeID_AfterUpdate", , False)
Resume Exit_Err_txtEmployeeID_AfterUpdate

End Sub


"If the breakpoint you mention is in the BeforeUpdate event, then you
will
not see it when the record is dirtied. The BeforeUpdate event fires
when
you attempt to save a record (e.g. by moving to a new record), not when
the
record is dirtied. "

I follow what you are saying above, however, in relation to my own
database, I don't understand it!!!

When I display my first record, everything is fine. I then move to the
next record in the sequence, and the breakpoint "If Me.Dirty = TRUE" is
TRUE, adn so the code in the BeforeUpdate is triggered. However, each
subsequent move to th enext or previous record, see's the "If Me.Dirty
= TRUE" condition, evaluating to FALSE.

Duncs

.