chrisb1981
Registered User.
- Local time
- Today, 12:31
- Joined
- Feb 7, 2007
- Messages
- 13
I currently have the code
which is not doing what I want it to. I know it is my knowledge of access which is letting me down. Basically if a record is created by John then the RecordCreator is set to John. If Phil goes in and amends the record it should put Phil's name in UpdateBy. So if the RecordCreator field is empty then it updates that field but if it is not empty UpdateBy field is updated. What it is doing is just putting the information into UpdateBy even when the RecordCreator is empty. I have tried putting in Null instead of "" but still the same happens.
Thanks for any help
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.RecordCreator = "" Then
Me.RecordCreator = CurrentUser()
Me.CreatedDate = Now()
Else
Me.UpdateBy = CurrentUser()
Me.UpdateDate = Now()
End If
End Sub
Thanks for any help