Reputation: 273
I have built a form called projects and an employees table in access 2007. One of the fields on the form is called installers sent. I would like the installers sent box to auto populate based on the first name of the employee in the employees table. How can this be done? If I need to put in more clarification, I will. This is my first time working with access so I'm not really sure what i'm doing
Edit: I'm not sure what you mean by code. But basically, I have a table that keeps track of employee info and another table to keep track of project details. Both also have an associated form for easy data entry. On the projects table, I have a field for which installers were sent to the project site. Obviously, all these individuals are also employees. What i'd like to be able to do is have employee information auto populate as the user types in an employees first name. I'm assuming I can set up a query to do this, but I'm not sure how
Upvotes: 1
Views: 95
Reputation: 91326
Your question is still somewhat confusing to me in that you only mention two tables but multiple installers (employees). This suggests that you need three tables:
Projects
ProjectID
Employees
EmployeeID
ProjectsEmployees
ProjectID
EmployeeID
This could then be set up as a main form and subform: Binding a combobox in subform Access (prettier subform Difficult cross-tab query)
An alternative is a listbox with the row source set to:
SELECT EmployeeName FROM Employees
INNER JOIN ProjectsEmployees
ON Employees.EmployeeID = ProjectsEmployees.EmployeeID
WHERE ProjectsEmployees.ProjectID = Forms!TheCurrentFormName!ProjectID
Upvotes: 1