Can I display a message if someone exceeds a set number of charact

K

KarenF

Using Access 2003 we have many forms and sub forms.

I know you can set a field length. In this case the field length is 100
characters. I know that Access beeps if that number of characters is
exceeded when entering data. My colleague wants to know if a message box can
appear should the data entry exceed the 100 characters the field length is
set to? At first I considered data validation, but I'm not sure how the len
function would work in setting a condition of validation. I was thinking
about conditional macros assigned to the field, set to run on exiting the
field, but I'm having trouble making this work. Perhaps my condition in
incorrect. I'm using the Len function to check if the length of the field
exceeds 100 characters.

Could anyone offer me any advice? I'm obviously missing something and any
advice is welcome.

Many thanks,

Karen
 
Z

zz

Check the field length in the 'before update' event and issue your message.
Personally, I don't see the point. It's better to prevent the characters from
being entered than to check for it afterwards.

-Dorian
 
K

KarenF

Thanks Dorian,

I'll get my colleague to try that. I agree with you on this one. I think
the field length needs optimising, else what's the point of changing it from
the default. I'm with my colleague tomorrow so I'll put this to them.
Meanwhile, incase he insists, I'll try your 'before update' approach.

Thanks.

Karen
 

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

Top