Union query, city lookup not working (1 Viewer)

Lifeseeker

Registered User.
Local time
Today, 15:13
Joined
Mar 18, 2011
Messages
273
Hi,

I have attached a test database that utilizes an UNION query to join two queries.

The city look is not working properly as you can see in the UNION query as it's showing numbers, instead of the actual city names.

Is there any way this can be fixed? I checked for the column bound, but city names are not showing properly in the UNION query.

Please help
 

Attachments

  • UNION QUERY CITY LOOKUP NOT WORKING.mdb
    416 KB · Views: 106

DCrake

Remembered
Local time
Today, 23:13
Joined
Jun 8, 2005
Messages
8,632
This is because you have fallen into the trap of using table level lookups instead of 1:m relationships between tables.
 

Lifeseeker

Registered User.
Local time
Today, 15:13
Joined
Mar 18, 2011
Messages
273
This is because you have fallen into the trap of using table level lookups instead of 1:m relationships between tables.

Thank D.

I'm not sure how I should go about making the changes. Are you implying that the city fields would have to be real solid values instead of looking up from city table?
 

DCrake

Remembered
Local time
Today, 23:13
Joined
Jun 8, 2005
Messages
8,632
You need to store the city PK as a FK in your table then in your query use a join on the two table to get the description.
 

Lifeseeker

Registered User.
Local time
Today, 15:13
Joined
Mar 18, 2011
Messages
273
You need to store the city PK as a FK in your table then in your query use a join on the two table to get the description.


sorry I'm really stuck here. It seems that I'm griping with the concept of FK and lookup.......

Could you be a little more specific? I should store city PK as foreign key in my table. Are you saying that I should store City as a foreign key in the lab table?
 

Attachments

  • UNION QUERY CITY LOOKUP NOT WORKING.accdb
    420 KB · Views: 83

Users who are viewing this thread

Top Bottom