Help on Lookup Please (1 Viewer)

magrfa

New member
Local time
Today, 08:45
Joined
Dec 5, 2017
Messages
8
All,

I am getting stuck on this and need some help please.

I need a value placing in one field dependant upon another field relevant to a list in a sub table like lookup in excel.

I have my master table (T_Main List)
Fields:
ID, Ward & Area & .........


I have a sub table (T_Ward).
Fields:
ID, Ward & Area

In the master table I am adding contact details for relevant locations within the locality

in the sub table there are a list of towns and an area code for each. There are multiple towns in each code

on my form (F_Edit) I have 2 bound combo boxs for Ward and Area linked to the master table.

I would like it when I select a town it will lookup the area code from the table and add it to the area field on the main table

Cheers in advance for any help
 

isladogs

MVP / VIP
Local time
Today, 08:45
Joined
Jan 14, 2017
Messages
18,216
You are assuming that it's necessary to duplicate the area code.
Why not use a query linking both tables to get the value as needed.

Otherwise use an update query to get the values.
However, whilst you have a common field called Ward, there seems to be no field called Town
 

magrfa

New member
Local time
Today, 08:45
Joined
Dec 5, 2017
Messages
8
Thanks for your response.

Ward is just the name given to the field with the town names.

It does need to go in that table because of reports that come off that table.

Any suggestions on a way for it to populate?

Cheers
 

isladogs

MVP / VIP
Local time
Today, 08:45
Joined
Jan 14, 2017
Messages
18,216
Thanks for your response.

Ward is just the name given to the field with the town names.

It does need to go in that table because of reports that come off that table.

Any suggestions on a way for it to populate?

Cheers



The reports could also be based on a query. Otherwise suggest you use an update query to populate

Not at my computer so can't write something for you now


Sent from my iPhone using Tapatalk
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:45
Joined
Feb 19, 2002
Messages
43,263
Using "ID" as the PK of all tables simply leads to confusion. Remember the old Bob Newhart show where his neighbors were three brothers all named Darrell.

So - WardID, Ward, Area

Then in the main table

CustomerID, WardID, etc.

All you need is WardID. You use a query to bring up the Ward name and Area whenever you want to display them.
 

Users who are viewing this thread

Top Bottom