ByronJohnson
MIS
I was wondering if any of you knew the best way to set up a form where depending on what items are selecting in the combo boxes will display inforomation in a list box that is based off of a query. In the query all the fields that are displayed in the combo boxes are in the query. The list box displays two items based of the query and the third item is a count of those fields. Hope that makes some sense. I am new with using Access.
I am using the code:
Private Sub cmdCompute_Click()
Dim critstr As String, x As Integer
For x = 1 To 8
If Me("combo" & x) <> "" Then
critstr = critstr & Me("combo" & x).Tag & " = '" & Me("combo" & x) & "' And "
End If
Next x
critstr = Left("critstr", Len("critstr" - 5)
Me.picList.RowSource = "SELECT Distinct lacIbase, Mutation, Count(Mutation) As [Number Observed] FROM The_Big_Query WHERE " & critstr & " group by lacibase, mutation"
Me.Refresh
End Sub
But I couldn't get this to work. I get an error with the Left function.
Any insight would be great.
Thanks
I am using the code:
Private Sub cmdCompute_Click()
Dim critstr As String, x As Integer
For x = 1 To 8
If Me("combo" & x) <> "" Then
critstr = critstr & Me("combo" & x).Tag & " = '" & Me("combo" & x) & "' And "
End If
Next x
critstr = Left("critstr", Len("critstr" - 5)
Me.picList.RowSource = "SELECT Distinct lacIbase, Mutation, Count(Mutation) As [Number Observed] FROM The_Big_Query WHERE " & critstr & " group by lacibase, mutation"
Me.Refresh
End Sub
But I couldn't get this to work. I get an error with the Left function.
Any insight would be great.
Thanks