Im trying to write an if statement for a number box on my form. I want to set it so you can only enter in a set number of characters in the box. For example you cant enter any more or less than 5 numbers. If you do you get an error. The code that I wrote is half working any suggestions would be greatly apperciated.
I put this in the onEnter
The part that seems to work right now is if you enter in more than 5 numbers. For some reason I can not get it to error out if you enter in less than 5.
I put this in the onEnter
Code:
Dim number, zipCode As Integer Dim error As String number = 0 zipCode = 5 If number < zipCode error = " Not enough numbers. \n" ElseIf number > zipCode Then error = " To many numbers in field. \n" End If 'End If
Comment