Angello Pimental
08-06-2001, 10:10 AM
Ok...This is maybe be a bit confusing, but I will do my best to describe what I am looking to do.
I want to be able to dictate what value appears in a combo box based on a value selected from another combo box.
e.g. If a user selects a location such as Bahrain, from combo box1, the standard contact person's name for Bahrain will appear in combo box2. But the user must still has the option of selecting a different contact person if necessary from combo box2.
Does this make sense?? Any help or suggestions would be appreciated.
Thnx,
Angelo
Jack Cowley
08-06-2001, 03:33 PM
You will find your answer here. This is an Access2000 article but the code is the same for Access97 if that is your version:
http://support.microsoft.com/support/kb/articles/Q209/5/76.ASP?LN=EN-US&SD=gn&FR=0&qry=q209576&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000
Angello Pimental
08-07-2001, 04:09 AM
Thank you Jack for your advice.
But the article you pointed me to wasn't really what I was looking for. I was able to solve my problem though. I used the following code to dictate what value appears in combo1 based on combo2.
Me!combo2 = Me.combo1.Column(5)
Where the values for combo2 are stored in combo1's 5th column
Regards,
Angelo
Brian Hubley
08-07-2001, 02:13 PM
Angelo,
I have a very similar problem where I am trying to use 1 combo box to dictate 2 other combo boxes, however, I am new to access programing. Could you point me in the right direction or elaborate on your fix.
ever greatful
Brian
Angello Pimental
08-09-2001, 05:10 AM
Brian,
What I am about to describe will allow you to dictate what value appears in combobox2 based on the value select in combobox1.
First:
In the Row_Source of combobox1 you want to include the combobox2 field.
e.g. Combo1 field is State, Combo2 field is Capital, then in the Row_Source of combobox1 you should have:
Field: State Capital
Table: statinfo statinfo
Secondly:
Set the following properties for combobox1;
Column Count:2
Column Widths: 1";0"
Bound Column: 1
*Basically what you are doing is storing the information for combobox2 in combobox1, this way the information is related and easily referenced*
Thirdly:
In the After_update property of combobox1 put the following code:
Me!combobox2 = Me.combobox1.Column(1)
HTH
Angelo