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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007 Relationships

Status
Not open for further replies.

pcomms

Technical User
Oct 13, 2004
54
GB
Hi everyone

This will be simply answered I know but I am having trouble getting my head round relationships (of the Access kind and generally day to day but to keep things simple lets stick to my Access problems!)

OK, could someone explain in as simple terms as possible how I can do the follow, I know its easy for you guys but for me I have a headache.

So, in simple terms I want to create a data base where I have a list of companies (my table called "companies") with their address and telephone number. I then want a second table that contains all of the employees (my "employee" table) for each company.

I then want to create a form where I can input the data of the companies (I have no problem doing this) and a second form where I input the list of employees. In the second form I want a drop down box where I can select the name of the company from table "companies" but I also want to display the "companies" address and telephone number (also held in table "companies" as soon as I choose the company name. Also if I change the company name on the "employees " form it should update the table "companies"

As I have said I have a headache as I know I am nearly there but not quite....

Cheers everyone, paracetemol please
 
Can an employee work for more than one company?
If not, you can add a company field in the Employee table which would store the primary key field value from the Company table.

Then, on an Employee form, you can create a combo box bound to the company field. The row source of this combo box would select all the desired fields from the Companies table. You could then add locked and disabled text boxes to the Employee form with control sources like:
=cboCompany.Column(1)
You would need to use the name of your combo box. The Columns are numbered beginning with 0.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top