View Full Version : Autofill


mura
03-29-2005, 07:09 AM
I have a form based on a table with several fields. The table contains names of employees and their departments, etc.

When I fill in the form with the employees name, how can I have it autofill the dept?

I am not a programmer so if specific code is required, I would need to know exactly what it is.

Your assistance is appreciated.

Pat Hartman
03-29-2005, 11:04 AM
Assuming that the employee table contains deptID and the department table contains deptID and deptName, you would create a query that joins the two tables on deptID. You can then choose whatever fields you want from each table. Use this query as the RecordSource for your form or report rather than the employee table. Make sure you set the locked property for the deptName field to Yes because you don't want anyone to accidentally update the department name on this form.