J
Jim Ory
Using WinXP, Access2002
On a main form, using an unbound text box [status], using the On Current
event for the form I have the following:
Private Sub Form_Current()
On Error GoTo ProcError
'Moves Focus to Ham Call on record change
Me.strHamCall.SetFocus
If Not IsNull(Me.dteExpiration) Then
If Date >= Me.dteExpiration Then
Me.Status = "Expired"
Else: Me.Status = "Valid"
End If
End If
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume ExitProc
End Sub
If I statement out the first "If not . . ." and last "End If" lines, the
code works fine, except I get a "Valid" return for status with a null value
in [dteExpiration]. If I leave the lines intact, I get an error message, ". .
.. cannot find field, etc. ...."
How should I write this?
On a main form, using an unbound text box [status], using the On Current
event for the form I have the following:
Private Sub Form_Current()
On Error GoTo ProcError
'Moves Focus to Ham Call on record change
Me.strHamCall.SetFocus
If Not IsNull(Me.dteExpiration) Then
If Date >= Me.dteExpiration Then
Me.Status = "Expired"
Else: Me.Status = "Valid"
End If
End If
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume ExitProc
End Sub
If I statement out the first "If not . . ." and last "End If" lines, the
code works fine, except I get a "Valid" return for status with a null value
in [dteExpiration]. If I leave the lines intact, I get an error message, ". .
.. cannot find field, etc. ...."
How should I write this?