I have searched all over for this issue and cant find anything on it. It just doesnt make sense at all. I have some VBA that updates a few fields with username, date edited and similar info when a record is updated. I added an extra line to change a different date field when the record is updated, also. This date field already has a date in it, so its basically updating it to the date the record was edited from the original date that is in it. Here is the code
Code:
Private Sub Form_AfterUpdate()
If IsNull(Me.user_edit) Then
Me.user_edit = Environ("Username")
End If
If IsNull(Me.user_comp) Then
Me.user_comp = Environ("Computername")
End If
If IsNull(Me.user_date) Then
Me.user_date = Now()
End If
If Not IsNull(Me.date_added) Then
Me.date_added = Now()
End If
End Sub
I have this code trigger on the AfterUpdate event of the form. The first 3 variables change fine when a record is updated the first time, but they dont appear to change after the fields have a value in them. The 4th, which already contains data, causes the issue. After experimenting, it seems they probably all would. Basically, when I make an update, and try to go to the next record, it wont. It locks me in to the current record until I hate the ESC key and undo the changes I just made. It seems that all variables need both the IsNull and Not IsNull to make this work properly. Has anyone had an issue like this before?