My Assistant
|
|
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 |
|
|
|
![]() |
Feb 23 2012, 01:27 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 8,170 From: Pacific NorthWet |
This is only a guess, based on my interpretation of the tablenames you provided ...
I suspect that you have one table per (?lake, river, body of water, ...?). If that is a fairly accurate guess, your database would benefit from further normalization. ... and you'd need/want to do that BEFORE working out your cascading comboboxes. Please post a description of the underlying tables, and what kind of data your storing in them. Please provide the version of Access you're using. (by the way, basing a combobox directly on a table doesn't give you much flexability. Instead, consider building a query against the table(s) and using that query as the rowsource for the combobox.) Good luck! |
|
|
|
csparkes Three Levels Of Cascading Combo Boxes Feb 23 2012, 01:17 PM
accesshawaii First, I would ask about your table design. It... Feb 23 2012, 01:27 PM
RAZMaddaz Here is an example of what sounds like what you wa... Feb 23 2012, 01:43 PM
csparkes QUOTE (accesshawaii @ Feb 23 2012, 03:27 ... Feb 23 2012, 02:48 PM
Jeff B. If "normalization" and "relational ... Feb 23 2012, 04:27 PM
accesshawaii QUOTE I have separate tables set up with the numbe... Feb 24 2012, 07:31 AM
csparkes QUOTE (RAZMaddaz @ Feb 23 2012, 03:43 PM)... Feb 24 2012, 09:28 AM
RAZMaddaz Awesome!!! I'm glad you like my m... Feb 24 2012, 09:32 AM
accesshawaii Glad you got it working but I would seriously sugg... Feb 24 2012, 09:34 AM
Jeff B. I'll echo Dan's comments -- you may be fac... Feb 24 2012, 11:15 AM
csparkes Thanks for the advice. Problem is that there is a... Feb 24 2012, 12:49 PM
Jeff B. Just FYI ...
A LOT of Access "databases... Feb 24 2012, 01:08 PM
accesshawaii Jeff's advice is the way to go. The most impor... Feb 27 2012, 07:32 AM![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 06:54 PM |