The Student Room Group
Reply 1
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
Reply 2
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)
Reply 3
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.
This is whats entered as validation for a postcode on my database:

>LL00\ 0LL;0;_
Reply 5
I've tried it, it rejects the Notting Hill one
Reply 6
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
Reply 7
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
Reply 8
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!
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/noframes/PostCode-2-1-Release.htm

Having said that, for a coursework project you will probably get away with simpler validation.
Reply 10
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
Well, surprisingly that work for me.
Original post by xxx-Laura-xxx
YAY! that one worked, thanks soooooo much!

Me too
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
Well, surprisingly that work for me.