Discussion Locked

Linking Fields in MS Access

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a table "call Log". In this table I have 3 fields which I need to link together, So that when I choose a value from one field, the next field automatically shows a list relevant to the first field. The 3 fields are "Busines Unit" "Department"and "Location". Business unit is a lookup wizard, containing 5 entries. Each of these entries would have at least 5 related entries to display in the Department Field. and likewise for Department to Location fields. How can I set this up so that I get only the relevant information in the Department and Location Fields??

5 replies

by seagull data services

In the afterupdate event of the first field (combo box?) set the control source to limit the list in the second combo/list box, e.g.
Sub cboBusUnit_AfterUpdate()
me.cboDept.ControlSource="Select from [Call Log] c where c.[Business Unit]='" & me.cboBusUnit & "';"

Then do the same for the third field in the afterupdate event of the second field.
Hope this helps
If you need any more info just e-mail me at the above address.
John

by sankulpune

Hello Paddytraynor,

1) It would be preferable if you make the 'Business Unit' as the primary key of the table.
2) Create a form 'frmSearch', based on the table 'Call Log' using 'AutoForm : Columnar' wizard in the Form tab of the database window.
This will create a form with three text boxes for the three fields (assuming all are 'Text' type) "Busines Unit", "Department" and "Location".
3) Open the form 'frmSearch' in design view.
4) Delete the text box for the "Busines Unit" field.
5) Ensure that the 'Control wizards' button on the toolbox (at the top right corner of the tool box) is pressed and then place a drop down control on the form in the place of deleted Textbox for "Business Unit" field.
This will open the 'Combo Box Wizard'.
6) Select the radio button for 'Find a record on my form ...." and click 'Next'.
7) Complete the 'Combo Box' wizard by selecting the table name ('Call Log') and field name('Business Unit') when asked for.
8) Save and close the form.

Now when you open this form and select a 'Business Unit' in the combo box, corresponding 'Department' and 'Location' will be displayed in their text boxes.

SanganakSakha,
Simple And Effective Solutions To Small Problems, No QuickFixes.

This discussion is closed to new replies.