Question How to create fields that are dependent on each other?

BardiyaS

New member
Local time
Today, 04:57
Joined
Nov 21, 2011
Messages
8
Hi everyone,

I am very new to Access and I am not familiar with SQL.

Can someone explain to me how I can create fields that are similar to each other?

Let's say I have 3 fields in my table: Name, State, Area Code.

I want it so that each time I select "Name" the appropriate State and Area Code populate.

Anyway I can do this?

Thanks!
 
There are several techniques depending on what exactly you are trying to do. The most common reason for "lookups" is to show related data not to copy it and store it in another table. To create "lookups" without code, change the form's RecordSource to a query that joins the two tables. Pick up data from the main table to populate the form and then select lookup fields from the second table. On the form, create a combo for "name" (Name is a poor choice for a column name since it is the name of property attached to just about every object and can cause conflicts in VBA). The NameID will be the bound value and the RowSource will select the text value from the lookup table.

As soon as you select a value from the combo, the "lookup" fields will automagically populate. I like to set the lock property of these controls to yes to avoid accidental updating.
 
Thanks for the quick reply.

Is there a way you could break this down for me step by step? Or maybe send me a database with only 3 fields setup? I could learn it by just looking at the design. I know how to create forms and tables but I am not up to speed on queries... I kind of got lost after Recordsource...
 
Here's a database with tables from Northwind and one form. The form is based on a query that joins product, category, and supplier tables. Columns from the category and supplier tables are populated when you change the value of the category or supplier combo.
 

Users who are viewing this thread

Back
Top Bottom