Hi All,
I'm having some difficulty with an IF statement that checks if a text field's value is between a specified range of numbers, depending on the option of a combo box. There are two number ranges available, and I wish to check/validate according to a specific range based on the option the combo box has selected. What I'd like to do is essentially:
ComboBox has either Option 1 or Option 2 available to select.
And the code behind the textfield is something like:
IF
Me.ComboBox.Value = "Option 1" Then Me.TextField = Between 1 and 10 or MsgBox "Error"
ElseIf Me.ComboBox.Value = "Option 2" Then Me.TextFeild = Between 11 and 12 or MsgBox "Error"
End If
I can handle single range validations and if statements, but combining them into something like the above is vexing me. I assume I'm not nesting the statements correctly maybe?
Thanks for any help offered.
I'm having some difficulty with an IF statement that checks if a text field's value is between a specified range of numbers, depending on the option of a combo box. There are two number ranges available, and I wish to check/validate according to a specific range based on the option the combo box has selected. What I'd like to do is essentially:
ComboBox has either Option 1 or Option 2 available to select.
And the code behind the textfield is something like:
IF
Me.ComboBox.Value = "Option 1" Then Me.TextField = Between 1 and 10 or MsgBox "Error"
ElseIf Me.ComboBox.Value = "Option 2" Then Me.TextFeild = Between 11 and 12 or MsgBox "Error"
End If
I can handle single range validations and if statements, but combining them into something like the above is vexing me. I assume I'm not nesting the statements correctly maybe?
Thanks for any help offered.