Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down field and choosing correct factor

Status
Not open for further replies.

usfpjc

MIS
Jan 1, 2002
27
0
0
US
I have created in a table a Field 1= "drop down" field, and two additional fields, each with a distinct constant.
Field 2 = Constant Y
Field 3 = Constant Z

I want to assign the correct constant when I choose a particular item from the drop down field.

Example: Drop down field has two choices: A or B
If I choose "A" from the drop down field, I want to get "Y"
If choose "B" from the drop down field, I want to get "Z"

How do I do it?
 
I guess that what you want is a sort of lookup table:[tt]
Code text PrimaryKey
ConstValue text

Code ConstValue
---- ----------
A Constant Y
B Constant Z
[/tt]
This lookup table may be the RowSource of a ComboBox in your form.

The Code field may be defined in another table as ForeignKey.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
If you are using lookup fields in your table design, you might want to review this link about the evils of these
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top