Discussion Locked

Updating controls in MS Access

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to update a field, in a form, with information based on another field in the same form. For example, When I choose "John Doe" for the name field (a list box), I would like the "Dept" field to automatically update with John Doe's dept.

1 reply

by bpaton

You can do it with the Dlookup function. If "Name" and "Dept" are fields in the "Employee" table that the list box refers to, and "fname" and "fdept" are the corresponding fields on your form. Then select properties of the "fdept" field and in the control source field write the expression =DLookUp("[Employee]!dept","[Employee]","[Employee]!name=[fname]")

Brian

This discussion is closed to new replies.