Validation Rule

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to add a Validation Rule under Properties of a text box that ensures
that the length of characters entered into the text box is no more than 50.
I know how to code this in VBA as an After Update event , but how would I do
it as a Validation Rule under the Data tab? Thanks.
 
The name of my textbox is "PONum". I tried Len(PONum)<50 and it didn't work.
In your example, what would go in the Text part?

What I'm trying to do is prevent users from entering a purchase order number
(text field) that is greater than 50 characters.

Ken



Ruskin Hardie said:
Have you tried;
Len([txtTextBox].[Text])<50



Ken said:
I'd like to add a Validation Rule under Properties of a text box that ensures
that the length of characters entered into the text box is no more than 50.
I know how to code this in VBA as an After Update event , but how would I do
it as a Validation Rule under the Data tab? Thanks.
 
Ken,

Try...

Len([PONum])<51

The square brackets will tell Access to look at the Field
with that name.
 
Back
Top