UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Three Levels Of Cascading Combo Boxes, Office 2010    
 
   
csparkes
post Feb 23 2012, 01:17 PM
Post #1

New Member
Posts: 16



Hi,
I'm trying to set up three cascading combo boxes. I have the first two set up and working but when I try to add the third I get a blank drop down list. The second combobox is a mutliple row source and for the third, I'm trying to do a single source table. Don't know much about code.

My first box (cboreservoir) has the following code AfterUpdate:

Private Sub cboreservoir_AfterUpdate()
On Error Resume Next
Select Case cboreservoir.Value
Case "Burnt"
cbostructurenumber.RowSource = "tblBurnt"
Case "Cat Arm"
cbostructurenumber.RowSource = "tblCatArm"
Case "Granite"
cbostructurenumber.RowSource = "tblGranite"
Case "Hinds Lake"
cbostructurenumber.RowSource = "tblHindsLake"
Case "Long Pond"
cbostructurenumber.RowSource = "tblLongPond"
Case "Meelpaeg"
cbostructurenumber.RowSource = "tblmeelpaeg"
Case "Snook's Arm"
cbostructurenumber.RowSource = "tblsnooksarm"
Case "Upper Salmon"
cbostructurenumber.RowSource = "tbluppersalmon"
Case "Venam's Bight"
cbostructurenumber.RowSource = "tblvenamsbight"
Case "Victoria"
cbostructurenumber.RowSource = "tblvictoria"
End Select
End Sub



My second box (cbostructurenumber) has the following code AfterUpdate

Private Sub cbostructurenumber_AfterUpdate()
On Error Resume Next
cbostructurename.RowSource = "Select tblstructurename.structurename " & _
"FROM tblstructurename " & _
"WHERE tblstructurename.label = '" & cbostructurename.Value & "' " & _
"ORDER BY tblstructurename.structurename;"

End Sub

My single source table for the third combobox is tblstructurename where [label] is a full list of the structure numbers and [structurename] is the corresponding structure name.

Can anyone help me with this coding? I'm lost at this point.

Thanks
Go to the top of the page
 
+
 
Start new topic
Replies
csparkes
post Feb 24 2012, 12:49 PM
Post #2

New Member
Posts: 16



Thanks for the advice. Problem is that there is a pile of inspection and structure information I imported from an excel spreadsheet, since that was the way it was decided to record all this data originally. I suggested a database would be easier to manage so I have a hybrid type of database set up where I have some normalized tables relating to the reservoirs and unique structure id's but still have to deal with the original data that came from the spreadsheet.

Thanks again for your help.
Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 12:13 PM