When I delete all of the data within a field that had values, my vba code is giving me errors (invalid use of null). I've modified it as you see below. Does this make sense or would there be a better way to handle this situation?
Previous code
Changed to:
Previous code
Code:
Private Sub Purpose_Agenda_AfterUpdate()
'http://eileenslounge.com/viewtopic.php?f=29&t=10183
'Skips warning message if no spelling error
If Not IsNull(Me.Purpose_Agenda) Then
With Me.Purpose_Agenda
.SetFocus
.SelStart = 0
.SelLength = Len(Me.Purpose_Agenda) 'Errors here.
End With
DoCmd.SetWarnings False
RunCommand acCmdSpelling
DoCmd.SetWarnings True
End If
End Sub
Changed to:
Code:
.SelLength = Len(Nz((Me.Purpose_Agenda), 0)) ' I've added the Nz to the .SelLength portion. Modified from the original code.