Linking tables

seanog2001

Registered User.
Local time
Today, 03:28
Joined
Jun 26, 2006
Messages
67
I am looking to lonk tables in a database.

I have one table a pc tables which has a list of pc's

the other table is a pc software table which has a list of software

i want to build a form to show the pc's and their software how do i do this
 
Hi
Basically you need a linking table between your two tables.
Assuming your PC table is something like lngPC as an autonumber field and strPC as a text description of the PC (e.g. Frank's laptop), and your software table is something like lngApp as an autonumber and strApp as a text description of the application (e.g. Windows XP Pro), then your linking table will be something like lngLink as an autonumber, lngLinkPc as a long integer and lngLinkApp as a long integer.
Thus if Frank's laptop is PC 193 and Windows XP Pro is Application 26 the relevant entry in yout link table would be lngLinkPc = 193 and lngLinkApp = 26

You can then build a query off this to populate a table
Hope this helps
 
Just to add to Malcy's answer:

You have a many to many relationship between your two tables. The linking table is often referred to as a junction table. Do a search in these forums on many to many and junction tables for lots of help on this subject.
 
Malcy said:
Hi
Basically you need a linking table between your two tables.
Assuming your PC table is something like lngPC as an autonumber field and strPC as a text description of the PC (e.g. Frank's laptop), and your software table is something like lngApp as an autonumber and strApp as a text description of the application (e.g. Windows XP Pro), then your linking table will be something like lngLink as an autonumber, lngLinkPc as a long integer and lngLinkApp as a long integer.
Thus if Frank's laptop is PC 193 and Windows XP Pro is Application 26 the relevant entry in yout link table would be lngLinkPc = 193 and lngLinkApp = 26

You can then build a query off this to populate a table
Hope this helps


Ive tried this and got to the stage where i have a table with the pc number and software id but their is no data in this table how do i populate this table with data.
 
do you know how i would populate the table with a query??
 
OK
If you have populated the table then the next thing to do is create a query to turn the numbers into something meaningful.
Create a new query in design view. Add your three tables and link the fields from the junction table.
Now drop down the fields you want into the query (double click or pull down).
You should then have a view which shows that the named PC ahas the named software.
You can build a continuous form to show the results more easily
 

Users who are viewing this thread

Back
Top Bottom