I'm sure this is a very simple one.
I'm checking an ABN number field. The user can put in 11 digits or N/A
here is the code
AbnFld source is a short text field
My logic is there is three options.
11 digits - OK
N/A or n/a - OK
A mixture of both alpha and numeric or less than 11 digits - should show the MsgBox and setFocus
There is no input mask on the field in the form controls
My error is
If I put 23456 or anything less than 11 digits it creates an Run Time error 13 type mismatch. Same if I put in N/A
If I put in 12345678901 all is ok and it formats the field as required'
Any Help will be appreciated
I'm checking an ABN number field. The user can put in 11 digits or N/A
here is the code
Code:
If Len(Me.AbnFld) = 11 Then
Me.AbnFld.InputMask = "00\ 000\ 000\ 000;;_"
Else
If Me.AbnFld = "N/A" Or "n/a" Then
Exit Sub
Else
MsgBox " The ABN number must be filled in with the 11 digit mobile number or N/A"
Me.AbnFld.SetFocus
Exit Sub
End If
End If
AbnFld source is a short text field
My logic is there is three options.
11 digits - OK
N/A or n/a - OK
A mixture of both alpha and numeric or less than 11 digits - should show the MsgBox and setFocus
There is no input mask on the field in the form controls
My error is
If I put 23456 or anything less than 11 digits it creates an Run Time error 13 type mismatch. Same if I put in N/A
If I put in 12345678901 all is ok and it formats the field as required'
Any Help will be appreciated