How can I relate two fiels together?

S

Samad Hanifi

I`d like to relate two fields together so that when I choose one of them from
a lookup list, the other filed get the appropritaed predefined value.

For example If I choose "1", "Apple" Appears and If I choose "2", "Orange"
Appears.

BGDS
Samad
 
D

Duane Hookom

Start with:

- table of your two fields with records
- form based on your main table
- combo box bound to a field in your main table and a row source of your
table with two fields

If you have questions, check Combo box in Help
 
J

John Vinson

On Mon, 27 Sep 2004 01:03:06 -0700, Samad Hanifi <Samad
I`d like to relate two fields together so that when I choose one of them from
a lookup list, the other filed get the appropritaed predefined value.

For example If I choose "1", "Apple" Appears and If I choose "2", "Orange"
Appears.

BGDS
Samad

It is probably neither necessary nor wise to do this. The second field
would be redundant, since its value is always defined by the first
value.

If you just want to *display* "Apple", while storing 1 in the table,
you can use a Form with a combo box. Create a table (a "lookup table",
but I would recommend that you NOT use the Access "lookup wizard")
with two fields; the primary key would be the numeric value and you'ld
have a text value as the second field.

In your main table include just the numeric field.

On your Form, put a combo box based on the lookup table. The combo box
wizard will offer the option of concealing the numeric ID and
displaying the text.

That way the computer sees the stable, compact numeric value; the
human being sees the meaningful text; and both end up happier.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top