Link to home
Start Free TrialLog in
Avatar of 4charity
4charity

asked on

Dirty skipping line in code

I have a form on which I capture a User's ID and timestamp when a record is entered. However, sometimes another user will look at the record (before it is worked on), and that info gets recorded. I don't want that situation. So I put a Dirty criteria on the code. The thought is that the info will only be captured if it was the first time the record was actually worked on (not viewed):

If IsNull(Me.DateInvoiceInDTU) And Me.Dirty = False Then
        Me.DateInvoiceInDTU = Now()
        Me.UserLoggedInvoice = GetUserCredentials(2)
        Me.text2 = Me.ActiveControl.Name
End If

This code works, in that the Date is not recorded, and the text2 field is not recorded. However, the UserLoggedInvoice is recorded. Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial