validation

11am

New member
Local time
Today, 20:44
Joined
Apr 21, 2005
Messages
5
hi im really new to access and i need data validation for a telephone number field. i need it so the user cannot enter any text in there only numbers. so far i have the following code:
Private Sub telephone_number_Enter()
If notNumeric Then
MsgBox "Only numerical characters allowed"
Cancel = True

End If
End Sub

this doesnt work i have opened the form in design view double clicked the text box and put it in there am i putting it in the wrong place or is the code wrong.
 
You need to validate the values using the forms KeyPress event. Search the forum for the keyword "KeyPress" and also with my user name for I have posted sample code on how to do it many moons ago.
 

Users who are viewing this thread

Back
Top Bottom