Just to add to what RickD said; you can also call the users Username to see who the person is editing the record.(This is what i do and it works great). You could even go as far as locking records using this method. If you wish to go this far let me know and i can help
What I want to do is if the record is being modified, I want that another user wouldn't be able to even open the form for the modification of the same record
In the on_current event procedure which I outlined previously you could set the fields to locked, as follows:
Private Sub Form_Current()
If Me.Dirty = True Then
MsgBox "This record is being edited, you cannot update this record."
[field1].locked = True
[field1].locked = True
[field1].locked = True
'...etc I don't think you can lock the whole form so you have to lock the individual fields
else
[field1].locked = False 'this unlocks the field if not being worked on
[field1].locked = False
[field1].locked = False
End If
End Sub
In the on_current event procedure which I outlined previously you could set the fields to locked, as follows:
Private Sub Form_Current()
If Me.Dirty = True Then
MsgBox "This record is being edited, you cannot update this record."
[field1].locked = True
[field2].locked = True
[field3].locked = True
'...etc I don't think you can lock the whole form so you have to lock the individual fields
else
[field1].locked = False 'this unlocks the field if not being worked on
[field2].locked = False
[field3].locked = False
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.