relations problem

A

atledreier

Hello

I'm trying to wrap my head around databases. I've usen Excel for much
of this stuff before, but my dataset has outgrown that a long time
ago.

What I'm trying to do here is this:

I have a table of tag-numbers with data such as description, location
and several other fields.

I have a table of cables that have a from-tag field and a to-tag
field.
I have a lookup (used the wizard) so that I can select from a drop-
down from the tag table, and show the corresponding tag description in
the drop down list. This works fine.
I would like to have a query with the tag descriptions too, in their
own fields.

So I want my cable info query to be:

Cable # - Cable description - From Tag -From tag description - To Tag
- To tag description.

How can I do this?
 
J

Jim Ory

It would appear that you need to structure your tables as such:

Cables

pkCableID Number (indexed as Primary)
strCableDescription Text
(other info as needed)

Tags

pkTagId Number
pkCableID number (make as foreign key) (indexed, duplicates OK)
strFromTag text
strFromTagDesc text
strToTag text
strToTagDesc text

In your query add the two tables. The query will make an auto join line
using the pkCableID. Add the fields to the query that you need and run the
query. Each cable will then have its own Tag and related information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top