Validation Rule

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.
 
G

Guest

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.
 
G

Gary Miller

Ken,

Try...

Len([PONum])<51

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top