Need to use dbList in a one-many-many scenario 
Author Message
 Need to use dbList in a one-many-many scenario

I have three dblists bound to three data controls.  What I am trying to do
is to display the values of dbList#2 based on the selection on dbList#1.
Likewise, I need the value of dbList#3 to depend on the selection in
dbList#2.

I an having substantial problems going beyond the first level.  Does any one
have any ideas, example code that might help me?  Here is what I am using

Maurice Muoneke


Option Explicit
Dim sdB As Database
Dim lakeItem, elevItem, dbString, rsName As String

Private Sub datElev_Reposition()

lakeItem = dbLstLake.BoundText
elevItem = dbLstElev.BoundText

dbString = App.Path + "\Site Selection.MDB"     'define database path
Set sdB = OpenDatabase(dbString) ''define species code list database

rsName = "SELECT * FROM [Type] WHERE Lake= '" & lakeItem & "' AND Elev= '" &
elevItem & "'"
datType.DatabaseName = dbString
datType.RecordSource = rsName
'datType.Refresh

End Sub

Private Sub datLakes_Reposition()

lakeItem = dbLstLake.BoundText

dbString = App.Path + "\Site Selection.MDB"     'define database path
Set sdB = OpenDatabase(dbString) ''define species code list database
rsName = "SELECT * From Elevation where Lake= '" & lakeItem & "'"
datElev.DatabaseName = dbString
datElev.RecordSource = rsName
'datElev.Refresh

End Sub

Private Sub Form_Load()

datLakes.DatabaseName = App.Path + "\Site Selection.MDB"
datLakes.RecordSource = "SELECT * From Lakes"
datLakes.Refresh
lakeItem = datLakes.Recordset.Fields(0).Value

datElev.DatabaseName = App.Path + "\Site Selection.MDB"
datElev.RecordSource = "SELECT * From Elevation where Lake= '" & lakeItem &
"'"
datElev.Refresh
elevItem = datElev.Recordset.Fields(1).Value

datType.DatabaseName = App.Path + "\Site Selection.MDB"
datType.RecordSource = "SELECT * FROM [Type] WHERE Lake= '" & lakeItem & "'
AND Elev= '" & elevItem & "'"

End Sub



Fri, 23 Feb 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to populate one dblist based on another dbList value

2. Using DBList boxes (Newbie help needed)

3. Rather unique scenario which needs attention!

4. PROBLEM HELP - Data control on one form and dblist on the other

5. DBList box Question (easy one :)

6. DBList box Question (easy one :)

7. PROBLEM HELP - Data control on one form and dblist on the other

8. DBList with more than one item

9. DBList with more than one item per column

10. Populate Listbox, DBlist or Datalist control with several columns in one row with ado

11. DBList with more than one item

12. DBList with more than one item

 

 
Powered by phpBB® Forum Software