field value depening of choice from combobox

stylo4321

Registered User.
Local time
Today, 13:36
Joined
Jul 9, 2008
Messages
12
Hy

In my database I have two tables one with source info table1 and one table2 I will make a form.

Table1 has information like
code name
1 name1
2 name2
3 name3

Table2 has this
a column with a combobox where you can choose name1,name2,...(thisworks)

I would like, when you choose name1 from the combobox a field of the second column with code: "1" will be populated. and When you choose name2 from the combobox the field wil be "2"

any suggestions?
 
Why would you need to do this? You should store your Key column in your combo field then relate back to the original table to fetch the display data.

Storing data in 2 places is not done, unless you have a very explicit and very very very good reason for it.
 
as namliam stated, it is not ideal to store data twice. if i understood your question, you would like to have sort of a "search form". If this is the case, i would suggest that you will base your form on a query, then create an unbound combo box which you can populate it with the names from your table, and then reference your combo as a criteria in your query, so that your form will display only the relevant records.
 

Users who are viewing this thread

Back
Top Bottom