PDA

View Full Version : Solved: validating field content



eed
01-10-2007, 01:17 PM
Hi, all,

I have a field where I would like users to be able to enter numerals and certain symbols (i.e., "-", "&", and ",") but not letters. Number fields will not store symbols, so I have to define the field as Text, but I want to prohibit the entry of letters.

Is there a way I can use a validation rule or some other property to automatically limit entry in the field to numbers and symbols? Or will I just have to use VBA on the field's AfterUpdate event on a form, to check for prohibited characters?

I'm perfectly capable of coding the latter if it's the only available answer, but I'm really hoping that there is a way to control this without my code having to manually check each character in the value.

Thanks in advance!!! :content:
~ eed

OBP
01-11-2007, 05:10 AM
eed, I think that you are limited to doing it in the field's After Update event procedure using VBA.
I can't find any way for the field's validation to check individual characters in a string of characters.
As you know in VB it is very straightforward.

eed
01-11-2007, 12:26 PM
Okay, thanks, OBP. I knew it would be straightforward in VBA but thought it was worth asking if there were any non-VBA way. Oh, well. I guess I will just take the path of least resistance and write the code! Thanks for the response.
~ eed