How can you limit fields to certain lengths. For example I have a policy number field that is 10 characters long. I need for it to give an error message or something if they dont key in at least 10 numbers.
Can anyone help?
Thanks
(Access 2003)
How can you limit fields to certain lengths. For example I have a policy number field that is 10 characters long. I need for it to give an error message or something if they dont key in at least 10 numbers.
Can anyone help?
Thanks
(Access 2003)
I want to Limit the length of a Fiel to 10 characters. this can be done in the following ways:
Name of my Field is SS
In the Table design sel Validation Rule to:
Len([SS])=10
Or if you want the validation to be done in the form.
Go to the Properties of the Text Box and in Data section in Validation Rule Type:
Len([SS])=10
In Both cases type the message you want to prompt in the Validation Text.
or You can include this code below in the BeforeUpdate Event of the Field in the Form:
Private Sub ss_BeforeUpdate(Cancel As Integer)
Dim intLenght As Integer
intLength = Len(Me.ss)
Select Case intLenght
Case Is <> 10
MsgBox "Minimum 10 Characters"
Cancel = True
End Select
End Sub
Remember to substitute SS with the name of your Field.
This are a few ways if this solves your problem mark the thread solved.
worked perfectly thank you
please mark this thread solved!!!!!!!!!!! This will help some one with the same problem get assured answers.
found it sorry