View Single Post
  #4  
Old February 25th, 2008, 04:52 AM posted to microsoft.public.access,microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default maximum number of characters

In the before update event for the control

If Len(Me.ControlName.Text) 6 Then
Msgbox "No more than 6 characters allowed"
Cancel = True
End If

Jeanette Cunningham

" -Obama" wrote in message
...
Thanks, Can I do it in a form level?


"Jeanette Cunningham" wrote in message
...
-Obama,
you could do this in the table by adjusting the Field Size property for
that
field if it is a text field.

For a number field you could write a validation rule for the table like
this:
For a field called MyNbrTest
Validation rule: Len([MyNbrTest])7
Validation text: No more than 6 digits allowed

Jeanette Cunningham

" -Obama" wrote in message
...
I am using access 97. How do I limit the number of character of a control
in a form at form level? Thanks.