Help with if elseif verification
Stewart,
I removed some "dots" to test this without a form. The following seems to
work. Hope this helps.
Chris
Sub Hmm()
Dim Msg, Style, Title, Response
Dim txtQtyValue As Integer
Dim txtCntValue As Integer
txtQtyValue = 11
txtCntValue = 15
x:
' Code to get new value.
'
'...
If Not IsNumeric(txtQtyValue) Then
MsgBox "Please enter a cashier number"
Exit Sub
ElseIf txtQtyValue txtCntValue Then
MsgBox txtQtyValue - txtCntValue
Exit Sub
ElseIf txtQtyValue 10 Then
Msg = "You chose " & txtQtyValue & " cashiers. Is this correct?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "Verify Input"
Response = MsgBox(Msg, Style, Title)
If Response = vbNo Then
MsgBox "Please re-enter the correct number of cashiers"
Exit Sub
Else
GoTo x
End If
Else
MsgBox " its not working"
Exit Sub
End If
End Sub
|