Simple Validation Question

mjmartin

Registered User.
Local time
Today, 21:48
Joined
Jul 29, 2004
Messages
28
Hi, this is my first time posting and I have a really stupid easy question, how do I build an expression which allows letters, numbers and an underscore? Much like (in PHP):

Code:
$regex =
  '^'.
  '[_a-z0-9-]+'.        /* One or more underscore, alphanumeric,
                           or hyphen charactures. */
  '(\.\'[_a-z0-9-]+)*'.  /* Followed by zero or more sets consisting
                           of a period and one or more underscore,
                           alphanumeric, or hyphen charactures. */
  '$';

I'm putting this in the Table design window under 'Validation Rule'.

Any ideas? Thanks very much.
 
Think you want Input Mask

Validation checks what has been put in. Input Mask controls the input.

Check the Help

Len B
 
Access will want none of this. It ain't PHP. It is based on VBA/VB for its string and naming paradigms.

Access does not have callable syntactic/semantic parser routines built in to use regular expression definitions. And if you 'roll your own' such routines, I'm pretty sure the design views won't accept them as criteria.

So I'm afraid I'm the bearer of sad tidings. (I'm willing to admit that a newer version of Access might have something like this - but I haven't seen it as recently as Access for XP.)
 
Sorry, I wasn't clear enough in the last post. All I want to do is only allow alphanumeric characters in this field.

EDIT: I just reread this and it looks a little rude, I assure you all it was not the intention, I've added a comma after the 'sorry', should read better now.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom