Postcode validation on microsoft access

Watch this thread
xxx-Laura-xxx
Badges: 0
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#1
Report Thread starter 15 years ago
#1
hey!! i'm having a few issues with validating the postcode field when entering a customer's details. is there any way you can have two validations, for example a postcode being entered in the format LL00/ 0LL and LL0/ 0LL eg TH17 9GJ and BR9 7JG

Thanks to anyone that helps!!
0
reply
Lil' J
Badges: 6
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#2
Report 15 years ago
#2
Yes, for the two examples you have given this input mask should work

L?09 0LL

? = A letter that may be entered
9 = A number that may be entered

Hope this works
1
reply
iainmacn
Badges: 10
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#3
Report 15 years ago
#3
I always find postcodes an utter nightmare and tell students not to both

problem is the first bit - as well as the possibilities already mentioned, there's stuff like

W2 4ED (Notting Hill)

think you can also have W11 etc as well, plus there's weird stuff such as

W1U 2QB (Marylebone)
0
reply
Lil' J
Badges: 6
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#4
Report 15 years ago
#4
the notting hill one will work with L?09 0LL as for the Marylebone thats just weird.

Just make sure you odn;t use a postcode like that in your test data.
0
reply
supernova2
Badges: 11
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#5
Report 15 years ago
#5
This is whats entered as validation for a postcode on my database:

>LL00\ 0LL;0;_
0
reply
iainmacn
Badges: 10
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#6
Report 15 years ago
#6
I've tried it, it rejects the Notting Hill one
0
reply
gnpatterson
Badges: 0
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#7
Report 15 years ago
#7
You _can_ enter the nottinghill one

You have to leave a gap between the first letter and the number,

This is not really a user friendly way of doing it. But I blame the post office

I think the solution has to be some custom functions or code if this is critical
0
reply
gnpatterson
Badges: 0
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#8
Report 15 years ago
#8
I think that the function

Like "?*# #*?"

as a validation rule in combination with a mask that forces upper case might be the answer it will accept all valid postcodes and reject most common errors.

It accepts

AB1 2CD or A12 34B or AAAAA1111 222222222BBBBBBBB

but will reject AAAAA11111111BBBBBB because there is no space

it reject any thing that is not letters then numbers then space then numbers then letters

HTH
0
reply
xxx-Laura-xxx
Badges: 0
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#9
Report Thread starter 15 years ago
#9
(Original post by Lil' J)
Yes, for the two examples you have given this input mask should work

L?09 0LL

? = A letter that may be entered
9 = A number that may be entered

Hope this works
YAY! that one worked, thanks soooooo much!
1
reply
theArchitect
Badges: 0
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#10
Report 15 years ago
#10
Postcodes are pretty tricky to validate in Access using input masks as there are so many different formats a postcode can take - as well as having some letters that aren't used. See here: http://www.govtalk.gov.uk/gdsc/html/...-1-Release.htm

Having said that, for a coursework project you will probably get away with simpler validation.
0
reply
iainmacn
Badges: 10
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#11
Report 15 years ago
#11
(Original post by gnpatterson)
You _can_ enter the nottinghill one

You have to leave a gap between the first letter and the number,
Ah okay, fair enough, but as you say, not very user friendly.

As far as I've been able to figure out it would need some coding to do it seamlessly for your average non-techy user
0
reply
Mia Gioia
Badges: 1
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#12
Report 5 months ago
#12
Well, surprisingly that work for me.
0
reply
Mia Gioia
Badges: 1
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#13
Report 5 months ago
#13
(Original post by xxx-Laura-xxx)
YAY! that one worked, thanks soooooo much!
Me too
0
reply
Mia Gioia
Badges: 1
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#14
Report 5 months ago
#14
you can also try L?00/0#LL please note, do not just input it this way, because when you are done, access will automatically put another / for you so when inputting it, just type L?00 0#LL or L?00 0LL. that will work.
Thank you
0
reply
Mia Gioia
Badges: 1
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#15
Report 5 months ago
#15
Well, surprisingly that work for me.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Have you done work experience at school/college?

Yes (156)
41.82%
Not yet, but I will soon (69)
18.5%
No (148)
39.68%

Watched Threads

View All