Very puzzling. I was in the midst of debugging some new code in an AfterUpdate Event when I notice strange behavior of a statement comparing two strings. It might just be because they are strings rather than variant. Thought I'd post anyway. I verified the contents running with the MsbBox displays going from one of the fields from text content to null and visa-versa. The comparison statement DOES NOT evaluate to true when one of the string values is Null. ("FldName") is the name of the variable to which the text box is bound and the OnAfterUpdate Event is coded "=ChgData("table name")", "ChgData" is the function being degugged. I.e., Public Function ChgData(FldName as string)
Code:
MsgBox "New: " & Me("tb" & FldName) & "What is it? " & IsNull(Me("tb" & FldName))
MsgBox "Old: " & Me("tb" & FldName).OldValue & "What is it? " & IsNull(Me("tb" & FldName).OldValue)
If Me("tb" & FldName) <> Me("tb" & FldName).OldValue Then
Doesn't work properly even if I change the function to: Public Function ChgData(FldName As Variant)