I have a field for a postcode. I'd like another field to auto contain an
'area' number, based on the first part (only) of the postcode. For example,
if a postcode LS4 4DJ was entered, another field would read the LS4 part and
enter '7' in that new field.
I have a table that contains an up to date list of just these first-part
postcodes...
Thanks,
Lap 5 4097
I assume your second table (TblAreas) looks like
SmallPostCode Area
LS 7
CO 5
etc
Create a query (QSmallPostCode) based on your table containing the post
codes containing the following
SmallPostCode:IIf(Len([PostCode])>=2,Left$([PostCode],2),"")
This extracts the first 2 letters (nothing for a missing post code
Then create a second query based on TblAreas and QSmallPostCode with a left
join between the 2 SmallPostCode fields
See if that gets you on your way
Phil
"Lapchien" <cc****@nospamplease.eclipse.co.uk> wrote in message
news:10***************@ananke.eclipse.net.uk... I have a field for a postcode. I'd like another field to auto contain an 'area' number, based on the first part (only) of the postcode. For
example, if a postcode LS4 4DJ was entered, another field would read the LS4 part
and enter '7' in that new field.
I have a table that contains an up to date list of just these first-part postcodes...
Thanks, Lap
Just use a case statement
Select Case Postcode
Case Trim(left(Postcode,3))="LS4"
Area = 4
Case Trim(left(Postcode,3))="LS5"
Area =5
Case.......
Area......
End Select
Patrick
On Mon, 1 Dec 2003 13:16:29 -0000, "Lapchien"
<cc****@nospamplease.eclipse.co.uk> wrote: I have a field for a postcode. I'd like another field to auto contain an 'area' number, based on the first part (only) of the postcode. For example, if a postcode LS4 4DJ was entered, another field would read the LS4 part and enter '7' in that new field.
I have a table that contains an up to date list of just these first-part postcodes...
Thanks, Lap
Thanks - I'll let you know how I get on...
--
Thanks,
Chris cc****@NOSPAMeclipse.co.uk
"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:3f***********************@mercury.nildram.net ... I assume your second table (TblAreas) looks like SmallPostCode Area LS 7 CO 5 etc
Create a query (QSmallPostCode) based on your table containing the post codes containing the following SmallPostCode:IIf(Len([PostCode])>=2,Left$([PostCode],2),"") This extracts the first 2 letters (nothing for a missing post code
Then create a second query based on TblAreas and QSmallPostCode with a
left join between the 2 SmallPostCode fields
See if that gets you on your way
Phil
"Lapchien" <cc****@nospamplease.eclipse.co.uk> wrote in message news:10***************@ananke.eclipse.net.uk... I have a field for a postcode. I'd like another field to auto contain
an 'area' number, based on the first part (only) of the postcode. For example, if a postcode LS4 4DJ was entered, another field would read the LS4 part and enter '7' in that new field.
I have a table that contains an up to date list of just these first-part postcodes...
Thanks, Lap
In the AfterUpdate event of the postcode field Try:-
Me.AreaCode = Mid(PostCode, 1, InStr(PostCode, " ") - 1)
On Mon, 1 Dec 2003 13:16:29 -0000, "Lapchien"
<cc****@nospamplease.eclipse.co.uk> wrote: I have a field for a postcode. I'd like another field to auto contain an 'area' number, based on the first part (only) of the postcode. For example, if a postcode LS4 4DJ was entered, another field would read the LS4 part and enter '7' in that new field.
I have a table that contains an up to date list of just these first-part postcodes...
Thanks, Lap
On Mon, 01 Dec 2003 17:12:33 GMT, pe********@mcmail.com wrote:
Sorry did not notice the "enter '7' in that new field"
'Presuming that LS4 is 7 in your area's Table
Try this
Private Sub PostCode_AfterUpdate()
Dim strAreaCode As String
strAreaCode = Mid(PostCode, 1, InStr(PostCode, " ") - 1)
AreaCode = DLookup("Areacode", "tblAreas", "postcode ='" & strAreaCode
& "'")
End Sub In the AfterUpdate event of the postcode field Try:-
Me.AreaCode = Mid(PostCode, 1, InStr(PostCode, " ") - 1)
On Mon, 1 Dec 2003 13:16:29 -0000, "Lapchien" <cc****@nospamplease.eclipse.co.uk> wrote:
I have a field for a postcode. I'd like another field to auto contain an 'area' number, based on the first part (only) of the postcode. For example, if a postcode LS4 4DJ was entered, another field would read the LS4 part and enter '7' in that new field.
I have a table that contains an up to date list of just these first-part postcodes...
Thanks, Lap This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tom |
last post by:
If anyone is looking for a cost effective postcode finder try this
http://www.postcodeanywhere.co.uk/
it is brilliant and very easy to use
|
by: Alan |
last post by:
Hi,
I'm getting as bit confused with my queries. I simply (!) want to insert a
space into a postcode field the 4th character from the right, so, for
example, ML201TQ becomes ML20 1TQ, which is...
|
by: Julian |
last post by:
Hi,
I am a very beginner in databases. I created a database table in Access 2003
and OOo 2.03 that includes name, address, postcode, phone numbers etc of our
customers. I would like to sort...
|
by: mark |
last post by:
I have a table of UK companies whose records I want to filter using a
map of postcode regions.
For the benfit of people outside the UK, our postcodes are a pain to
work with because they are not...
|
by: xhe |
last post by:
I am now developing a website which needs Canadian PostCode Database.
I can certainly buy one, but that will cost my hundered of $$, and my
website is only for education purpose, it won't make...
|
by: Mike P |
last post by:
Can anyone recommend some good postcode lookup software for UK postcodes
that can be integrated into your own applications?
Many thanks,
Mike
|
by: billynastie2007 |
last post by:
Hi i am writing a balloon race site and i am having problems with some functions to calculate the distance the balloon travels firstly i am reading my info from the database using the fetch assoc...
|
by: Pinna |
last post by:
Hiya, I am trying to select based on a range on postcode on a table. The field POSTCODE is a varchar2(8).
The problem is when refinng on 'where postcode between 'PE1' and 'PE29'', because this is...
|
by: dominicowen |
last post by:
Hi,
I have a customer database in Access 2003 with customers postcodes.
What I want to do is type in a postcode on access and it will link the postcode on to googlemaps without having to type...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |