Computing.Net > Forums > Database > automatically fill related fields

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

automatically fill related fields

Reply to Message Icon

Name: SandyR
Date: June 22, 2007 at 04:23:08 Pacific
OS: Windows XP SP2
CPU/Ram: Athlon 64 3000+ 512Mb RA
Product: Mesh
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: June 22, 2007 at 04:34:32 Pacific
Reply:

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.


0

Response Number 2
Name: SandyR
Date: June 22, 2007 at 04:36:22 Pacific
Reply:

Sorry, forgot to mention it was Access 2003.


0

Response Number 3
Name: pingy
Date: July 3, 2007 at 15:22:21 Pacific
Reply:

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.


0

Response Number 4
Name: SandyR
Date: July 6, 2007 at 05:52:40 Pacific
Reply:

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.


0
Reply to Message Icon

Related Posts

See More


access date query Access calculation



Post Locked

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


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: automatically fill related fields

fill in field automatically based on other 1 www.computing.net/answers/dbase/fill-in-field-automatically-based-on-other-1/626.html

Access database query www.computing.net/answers/dbase/access-database-query/287.html

What to use to make a complex DB www.computing.net/answers/dbase/what-to-use-to-make-a-complex-db/33.html