J
jlute
The following is driving me crazy. The first half of the code is fine
but the ElseIf isn't working. It doesn't matter if Percent IsNull or
Null - I can exit either way.
I've tried several things but can't get it.
Can anyone please give me a hand?
Thanks!
Private Sub Where_Exit(Cancel As Integer)
If IsNull(Me!Where) = False Then
If (Me!Where = "Used") _
And Len(Trim(Me!Percent & vbNullString)) > 0 Then
Beep
If MsgBox("% must be NULL!" & vbCrLf & _
"Click OK to set to Null.", vbOKOnly + _
vbQuestion) = vbOK Then
Me!Percent = Null
Cancel = True
DoCmd.GoToControl "Comments"
ElseIf (Me!Where = "Packaged" Or Me!Where = "Produced" Or Me!
Where = "Inventoried" Or Me!Where = "WIP") _
And IsNull(Me!Percent) = True Then
DoCmd.GoToControl "Percent"
End If
End If
End If
End Sub
but the ElseIf isn't working. It doesn't matter if Percent IsNull or
Null - I can exit either way.
I've tried several things but can't get it.
Can anyone please give me a hand?
Thanks!
Private Sub Where_Exit(Cancel As Integer)
If IsNull(Me!Where) = False Then
If (Me!Where = "Used") _
And Len(Trim(Me!Percent & vbNullString)) > 0 Then
Beep
If MsgBox("% must be NULL!" & vbCrLf & _
"Click OK to set to Null.", vbOKOnly + _
vbQuestion) = vbOK Then
Me!Percent = Null
Cancel = True
DoCmd.GoToControl "Comments"
ElseIf (Me!Where = "Packaged" Or Me!Where = "Produced" Or Me!
Where = "Inventoried" Or Me!Where = "WIP") _
And IsNull(Me!Percent) = True Then
DoCmd.GoToControl "Percent"
End If
End If
End If
End Sub