L
lcox400w
I have written if then else statements, but new to elseif. I have tried to
follow examples from others, but my code below is not working. When the code
is run, it never seems to get to the elseif portion of the statement. Can
someone help point me in the correct direction.
thanks
Private Sub Dispo_Exit(Cancel As Integer)
'Checks to see if the Dispo is "Open", if so, enables dispodate field
If Dispo = "Open" Then
DispoDate.Enabled = False
'If user leaves dispo field null or blank, the dispodate field is disabled
ElseIf Not IsNull(Dispo) Or Dispo = "" Then DispoDate.Enabled = False
Else
'If the user selects any dispo, other than OPEN, the dispo field is enabled.
DispoDate.Enabled = True
MsgBox "You must enter a dispo date next", vbOKOnly, "Enter Dispo Date"
DispoDate.SetFocus
End If
follow examples from others, but my code below is not working. When the code
is run, it never seems to get to the elseif portion of the statement. Can
someone help point me in the correct direction.
thanks
Private Sub Dispo_Exit(Cancel As Integer)
'Checks to see if the Dispo is "Open", if so, enables dispodate field
If Dispo = "Open" Then
DispoDate.Enabled = False
'If user leaves dispo field null or blank, the dispodate field is disabled
ElseIf Not IsNull(Dispo) Or Dispo = "" Then DispoDate.Enabled = False
Else
'If the user selects any dispo, other than OPEN, the dispo field is enabled.
DispoDate.Enabled = True
MsgBox "You must enter a dispo date next", vbOKOnly, "Enter Dispo Date"
DispoDate.SetFocus
End If