View unanswered posts | View active topics
It is currently Sat Jun 14, 2025 5:34 pm
|
Page 1 of 1
|
[ 4 posts ] |
|
Author |
Message |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5151 Location: /dev/tty0
|
Hello all,
I've got an Access 2010 db and I'm trying to validate a first name, I'm trying to say that it should only contain letters, an apostrophe, and a hyphen, but I can't find anything that doesn't require you to snoop every key stroke...
Many thanks,
Ben
|
Wed Feb 01, 2012 2:11 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
Regex validator? (You would probably need to do it through VBA)
Something like [a-zA-Z'-]+
I don't think you can snope a key stroke, only a completed field, otherwise every key press would fire validation
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Wed Feb 01, 2012 3:22 pm |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5151 Location: /dev/tty0
|
Cheers Finlay 
|
Wed Feb 01, 2012 5:46 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
That is a very simple one, you probably need a more comprehensive one though
For instance you wouldn't have a hyphen/apostrophe at the start or end character It's early, not had enough tea and as a result the way you join them escapes me...
but it would be (in a laypersons notation with partial regex)... [a-zA-Z] + (0...+ [a-zA-Z'-]+) + [a-zA-Z] then x'x and x-x are valid but 'xx, xx- and 'x' aren't
The above does cover you for 2 letter names though... not sure if you could validate 1 letter names (or if they exist)
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Thu Feb 02, 2012 8:39 am |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 36 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|