|
-
Jan 17th, 2003, 03:19 PM
#1
Thread Starter
Member
VBA (Access) & Postcodes
Hi, Can anyone help please.
In access 97, Customer table : Name: Address: PostCode: TelNo: Etc.
Within the UK any one PostCode can have 4 different ways of being presented, I.E
Examples.
AB10 1AB
AB101AB
Some PostCodes areas have only 1 number at begining,
AB1 1AB
AB11AB
All 4 are correct, but when exported for a courier company to use the Postcode format is not allways correct to what they want.
Can I Use code to select different InputMasks for each PostCode, This allowing any user to type however they want into that field but the end result is what is required. Below is whats accepted.
AB10 1AB Correct
AB101AB Should be AB10 1AB
AB1 1AB Correct
AB11AB should be AB1 1AB.
Code i'm playing with is:
Private Sub Post_Code_AfterUpdate()
Trim (Me.Post_Code) 'Remove spaces start/end (not working)
If Len(Me.Post_Code) = 7 Or Len(Me.Post_Code) = 8 Then
Me.Post_Code.InputMask = ">LL00 0LL;;_"
Else
Me.Post_Code.InputMask = ">>LL0 0LL;;_"
End If
End Sub
HELP Please!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|