Is there a way to actually make the field null after data has been deleted?
One thing that may be affecting this is the following code I have on the form.
Tracing through the code tells the story.
You have
Code:
If IsNull(Source_Last_Name) Then
Source_Last_Name = ""
Else
Me.Source_Last_Name = fProperCase(Source_Last_Name)
End If
So the code says:
If the control "Source_Last_Name" is NULL then
....set the control "Source_Last_Name" value to an empty string
else
..... change the control "Source_Last_Name" value to proper case
end if
I changed your code to
Code:
If IsNull(Me.Source_Last_Name) Then
Me.Source_Last_Name = vbNullString
End If
MsgBox "Is Null: " & IsNull(Me.Source_Last_Name)
Now enter a name in the "Source_Last_Name" control and move to the next control.
The msgbox function should fire and say "False" meaning the control is not null (has a entry).
Next delete the last name entry and move to another control.
The msgbox function should fire and still say "False".
Change the code to (lines commented out)
Code:
Private Sub Source_Last_Name_AfterUpdate()
' If IsNull(Me.Source_Last_Name) Then
' Me.Source_Last_Name = vbNullString
' End If
MsgBox "Is Null: " & IsNull(Me.Source_Last_Name)
End Sub
Do the same steps:
Enter a name in the last name control. The msgbox function should fire and say "False".
Then delete the name. The msgbox function should fire and now say "TRUE".
In effect, you were/are changing the NULL to an empty string (ie not null).
------------------------------------------------------------------------
Maybe you could use
Code:
Private Sub Source_Last_Name_AfterUpdate()
If Not IsNull(Me.Source_Last_Name) Then
Me.Source_Last_Name = fProperCase(Source_Last_Name)
End If
End Sub
or
Code:
Private Sub Source_Last_Name_AfterUpdate()
If IsNull(Source_Last_Name) Then
Source_Last_Name = "Unknown"
Else
Me.Source_Last_Name = fProperCase(Source_Last_Name)
End If
End Sub