Synchronizing three (3) combo boxes in a form.

I have in the form three combo boxes. a)cbo1 , b)cbo2 , c)cbo3.
I want to synchronize cbo1 with cbo2 and cbo2 with cbo3.
When I choose from cbo1 limits the records to cbo2  and then I choose from cbo2 limits the records to cbo3.
If you pleased write the complete code for this to understated.
Thank you
sathan48Asked:
Who is Participating?
 
Jeffrey CoachmanMIS LiasonCommented:
Did you try coffeeshop's code?

The technique you are refreeing to is called "Cascading Lists"
The technique is basically the same for Comboboxes and Listboxes.

Here are some great Tutorials:
http://www.fontstuff.com/access/acctut10.htm

One table
http://www.candace-tripp.com/download/cascadecombo2k.zip
Two Tables
http://www.candace-tripp.com/download/2table_cascadecombo2k.zip

JeffCoachman
0
 
Rey Obrero (Capricorn1)Commented:
writoing the complate code is impossible, since you have  not given a complete detail about your combo boxes, names, rowsource etc.,,

see this link

http://blogs.msdn.com/access/archive/2009/04/03/template-demonstrates-how-to-synchronize-combo-boxes.aspx
0
 
coffeeshopCommented:
Add the following code to your form:

The Queries for the Combos must include Combo1Val() and Combo2Val() as WHERE-Clause. You have to change the type "String" to "Long" or whatever you have.
Private sCombo1Val As String
Private sCombo2Val As String
 
Public Property Get Combo1Val() As String
  Combo1Val = sCombo1Val
End Property
Public Property Get Combo2Val() As String
  Combo2Val = sCombo2Val
End Property
 
 
Private Sub cbo1_AfterUpdate()
 
  If Not IsNull(cbo1.Value) Then
    sCombo1Val = cbo1.Value
  Else
    sCombo1Val = ""
  End If
  
  Me.cbo2.Requery
  cbo2_AfterUpdate
 
End Sub
 
Private Sub cbo2_AfterUpdate()
 
  If Not IsNull(cbo2.Value) Then
    sCombo2Val = cbo2.Value
  Else
    sCombo2Val = ""
  End If
  
  Me.cbo3.Requery
 
End Sub

Open in new window

0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
sathan48Author Commented:
To capricorn1:
So I give more details:
I have (3) tbls by name  tblContinents , tblCountries , and tblvarieties.
I want to make a form with THREE (3) combo boxes bound to the above tables by name cboContinets , cboCountries and cbovarieties.
When I select an item in  cboContinets drop down list on a form and
limit the choices in the cboCountries  drop down list so the cboCountries list shows only items
related to the item in the cboContinets  , and  when I select an item from cboCountries drop down list on a form and limit the choices in the tblvarieties drop down list so the tblvarieties list shows only items related to the item in the cboCountries drop down.
I appreciate if you can help me with a complete code.
Thank you

0
 
Rey Obrero (Capricorn1)Commented:
sathan48,
did you check the link i posted above?
0
 
sathan48Author Commented:
To capricorn1.
Yes I checked the link and I try it my form.
Don't work as I need , because the combo boxes is unbound.
I want yo be bound with the tables I told you before.
Thank you
 
0
 
sathan48Author Commented:
To boag2000
Yes I'll try the coffeshop's code ,but I can't made work.
 I'll try the first link you wrote me , and it's work perfect.
Thank you
0
 
Jeffrey CoachmanMIS LiasonCommented:
Thanks!
;-)
But I see no real reason why coffeshop's code would not work.
Make sure you substitute your actual names for the posted ones.

;-)

JeffCoachman
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.