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

Many to Many relationship & picklist/combo box

Status
Not open for further replies.

itdamon

MIS
Mar 18, 2002
69
0
0
US
I have 2 tables, tblSites and tblEmployees. I need to show which employees belong to which site. An employee can have many sites (apartment communities) and each site can have many employees assigned to it.

I created a "linking" table based on the primary ID of each table...it looks like this.

tblSites-
siteID (autonumber)-primary key
site name, address, etc.

tblEmployees
empID (autonumber) -primary key
name, address, etc.

tblSiteEmpInterest
SiteEmpID (autonumber) -primary key
siteID (number)
empID (number)

My Site input form has all the site information, and I want to be able to assign an Employee (up to 4) to the site.

I've tried a combo box on the form...and I can get each employee's name to pull into the combo box, but it won't let me select any of the names. Can anyone point me in the right direction? I'd be happy to submit the .mdb file if it would help.

Thanks,
Damon
 
i have a similar set up and here's a summary of what i do. first of all b/c there are many employees per site i suggest using a list box instead of a combo box. on the save event of the form i first delete all employees of the given site from the link table and then i loop the "selected" records of the list box and insert them inidvidually into the link table. hope this helps.

jeff

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top