R
Robert_L_Ross
I have some code that asks the user for information on a template:
Dim ACCTSSN As Integer
ACCTSSN = InputBox("Enter Borrower's SSN (123456789)", "SSN")
I check the value to make sure they put in 9 characters:
If Len(Trim(ACCTSSN)) <> 9 Then
ERROR = MsgBox("SSN must be 9 digits", vbOKOnly, "SSN Error")
GoSub SUB_GET_ACCTSSN
End If
Now how do I make sure they don't put in text/special characters? I
initially had the field set as a string, but thought that making it an
integer would prevent the field from accepting letters. It does accept
letters and gives me an error when I click OK on the box.
I also have other input boxes that I'm going to want to check to see if the
user put in a valid date format (00/00/00 or 00/00/0000 or 0/0/0000).
How can I check a variable to see if it's got the right format, or limit the
variable so you can't put an invalid value in it while using an input box to
obtain the value?
THX!
Dim ACCTSSN As Integer
ACCTSSN = InputBox("Enter Borrower's SSN (123456789)", "SSN")
I check the value to make sure they put in 9 characters:
If Len(Trim(ACCTSSN)) <> 9 Then
ERROR = MsgBox("SSN must be 9 digits", vbOKOnly, "SSN Error")
GoSub SUB_GET_ACCTSSN
End If
Now how do I make sure they don't put in text/special characters? I
initially had the field set as a string, but thought that making it an
integer would prevent the field from accepting letters. It does accept
letters and gives me an error when I click OK on the box.
I also have other input boxes that I'm going to want to check to see if the
user put in a valid date format (00/00/00 or 00/00/0000 or 0/0/0000).
How can I check a variable to see if it's got the right format, or limit the
variable so you can't put an invalid value in it while using an input box to
obtain the value?
THX!