Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relate a single table to multiple columns in another? 1

Status
Not open for further replies.

jgoodman00

Programmer
Jan 23, 2001
1,510
Am having a wood & trees moment here!

I have a table which needs to store a information about lichen species, & what their host species is.

I currently have a table which has a list of species for everything. I would prefer to keep a single species table. The user will select a lichen species, then a host species.

I am then faced with the problem of needing to relate a single table to two fields within another table.

At the moment I have:

ID
LichenID
HostID


Any ideas?


James Goodman MCSE, MCDBA
 
Sound to me like you need another table

TblSpecies TblHosts

Then a transactions table that store Date found, Found by and the primary key from the species and host table.

This will allow users to select a species, select a host and then fill in any other detail you need.



Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
I believe a self join would solve th problem:
Add a 'Host' field in the same table
Required: No

Create a one to many relationship between the primary key and 'Host' field.

If Host field is null, that is the top-level member. If not, it indicates the host species...

HTH



[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top