G
Gator
I need to add an additional criteria for the list query. How do I
incorporate the criteria where List2 will query based on Fields 5 & 6
selected in List0. It's works fine as is by querying just by Field6...but I
need to add Field5 to it.
List0 has the following as rowsource...
SELECT DISTINCT [2008Q2].[field5], [2008Q2].[field6], [2008Q2].[field7] FROM
2008Q2 ORDER BY [field7];
Code behind....
Private Sub List0_AfterUpdate()
Me!List2.Requery
End Sub
Private Sub List0_Click()
List2.RowSource = "select [2008Q2].[field12], [2008Q2].[field6],
[2008Q2].[field5] from 2008Q2 where ((([2008Q2].[field6])='" & List0 & "'));"
End Sub
Function AddNumbersInListbox(ListboxControl As ListBox) As Single
Dim lngLoop As Long
Dim lngSum As Single
lngSum = 0
For lngLoop = 0 To (ListboxControl.ListCount - 1)
lngSum = lngSum + ListboxControl.ItemData(lngLoop)
Next lngLoop
AddNumbersInListbox = lngSum
End Function
incorporate the criteria where List2 will query based on Fields 5 & 6
selected in List0. It's works fine as is by querying just by Field6...but I
need to add Field5 to it.
List0 has the following as rowsource...
SELECT DISTINCT [2008Q2].[field5], [2008Q2].[field6], [2008Q2].[field7] FROM
2008Q2 ORDER BY [field7];
Code behind....
Private Sub List0_AfterUpdate()
Me!List2.Requery
End Sub
Private Sub List0_Click()
List2.RowSource = "select [2008Q2].[field12], [2008Q2].[field6],
[2008Q2].[field5] from 2008Q2 where ((([2008Q2].[field6])='" & List0 & "'));"
End Sub
Function AddNumbersInListbox(ListboxControl As ListBox) As Single
Dim lngLoop As Long
Dim lngSum As Single
lngSum = 0
For lngLoop = 0 To (ListboxControl.ListCount - 1)
lngSum = lngSum + ListboxControl.ItemData(lngLoop)
Next lngLoop
AddNumbersInListbox = lngSum
End Function