Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Can anyone suggest the easiest way please to achieve the following; I may have totally overlooked the obvious!
Three of the fields I have in a table have related information, e.g. a person, their job and their area. When using a form to enter other data for a particular person (using a list box to pick the person), I would like their job and area filled in automatically. I don't want all 3 pieces of information put in 1 field, as I will be doing queries/reports for different jobs and areas. Also, if the person stated on the record changes, the updated person’s job & area must follow them.
Thanks in advance.

Depends on the forum interface in question. Most of them have some sort of "field changed" event you could use to run a query and fill the fields.

I don't know if I understand you right.
Do you want to fill in the Job and Area into a different table with the "other data"?
In that case you might have a design problem.
Allways try to avoid redundancy (double data).If it still is necessary then what Razor said is true only it's not so easy to find in Access.
In the code window for the form select in the left listbox (at the top of the window) "Form". In the right listbox select "Current". Now you have a sub that is called every time you skip from record to record in the query that is assigned to the form (this would be your person table).
If you want to have the "other data" table as source for the form then you assign your person table to the listbox you named.
Open the code window, select the name of your listbox in the left listbox of the code window and select "Click" in the right listbox. Now you have a sub that is called when you click the listbox. Here you can write code to copy the data.
It could be done in a way that the Job and Area are allready loaded in the listbox but that's more difficult to explain.

Sorry, I don't know what you mean by 'code window'.
I'll try to clarify what I need. The 3 linked fields are stored in one table for reference; I then have a main table with details of 'leads' assigned to different people, using forms to enter either new or updated records.
Each person will have many different records in this table, but I want to only enter the person's name on the form and then have Access fill in their job and area automatically on the main table. For various reasons I need to be able to see these fields alongside the 'lead' details.

![]() |
access date query
|
Access calculation
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |