If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Basic help with new form
Here's my question, stripped down:
I have an organization table. I have an employee table (multiple orgs each have individual employees). I have a training session table (employees attend training sessions.) However, employees will on occassion attend multiple training sessions. So I want to set up some way to create a new training session, and add multiple employees to that session. Bonus Question: Since we deal with quite a number of people, would there be a way to first create a listbox for organization, then a listbox for employee, to make finding that person easier? |
#2
|
|||
|
|||
Basic help with new form
However, employees will on occassion attend multiple training sessions.
So I want to set up some way to create a new training session, and add multiple employees to that session. what you have is a many-to-many relationship between employees and training sessions: one employee may attend many training sessions, AND one training session may be attended by many employees. in Access, you model a many-to-many relationship with a "join" or "linking" table, which acts as the "many" side of a one-to-many relationship between employees and training sessions. tblEmployees EmpID (primary key) FirstName LastName tblTrainingSessions SessionID (pk) Subject SessionDate tblEmployeeTraining EmpSessionID (pk) SessionID (foreign key from tblTrainingSessions) EmpID (fk from tblEmployees) relationships would be tblTrainingSessions.SessionID 1:n tblEmployeeTraining.SessionID tblEmployees.EmpID 1:n tblEmployeeTraining.EmpID hth "mjc" wrote in message ... Here's my question, stripped down: I have an organization table. I have an employee table (multiple orgs each have individual employees). I have a training session table (employees attend training sessions.) However, employees will on occassion attend multiple training sessions. So I want to set up some way to create a new training session, and add multiple employees to that session. Bonus Question: Since we deal with quite a number of people, would there be a way to first create a listbox for organization, then a listbox for employee, to make finding that person easier? |
#3
|
|||
|
|||
Basic help with new form
Bonus Question:
Since we deal with quite a number of people, would there be a way to first create a listbox for organization, then a listbox for employee, to make finding that person easier? at the form level, yes. the following assumes that each record in tblEmployees has a foreign key field which links the employee to a specific organization record in tblOrganizations. i'll call that field EmpOrgID. create the two listboxes, based on tblOrganizations and tblEmployees, respectively. i'll call the controls lstOrgs and lstEmps. in the RowSource property for lstEmps, set criteria on field EmpOrgID as Forms!FormName!lstOrgs in the AfterUpdate event procedure of lstOrgs, add the following code, as Me!lstEmps.Requery each time you select a different organization in lstOrgs, then lstEmps will be requeried to show only the employees who belong to that organization. hth "mjc" wrote in message ... Here's my question, stripped down: I have an organization table. I have an employee table (multiple orgs each have individual employees). I have a training session table (employees attend training sessions.) However, employees will on occassion attend multiple training sessions. So I want to set up some way to create a new training session, and add multiple employees to that session. Bonus Question: Since we deal with quite a number of people, would there be a way to first create a listbox for organization, then a listbox for employee, to make finding that person easier? |
#4
|
|||
|
|||
Basic help with new form
Thanks everyone. That was very helpful. I dug around a bit, and for the
"bonus question" ended up linking it to EmployeeID, and having it show [FirstName] & " " & [LastName] & " - " [Organization]. Very cool. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
using combo boxes with Filter by Form | baconroll | General Discussion | 3 | October 28th, 2005 04:23 PM |
ECHO Causing Problems | DS | General Discussion | 5 | May 17th, 2005 02:19 AM |
Cursor Positioning | Colin Hammond | General Discussion | 3 | November 2nd, 2004 08:42 PM |
Strange stLinkCriteria behaviour on command button | Anthony Dowd | Using Forms | 3 | August 21st, 2004 03:01 AM |
auto entry into second table after update | Tony | New Users | 13 | July 9th, 2004 10:42 PM |