Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form with multiple combo boxes refering to a List Box

Status
Not open for further replies.
Jun 26, 2001
41
US
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(&quot;combo&quot; & x) <> &quot;&quot; Then
critstr = critstr & Me(&quot;combo&quot; & x).Tag & &quot; = '&quot; & Me(&quot;combo&quot; & x) & &quot;' And &quot;
End If
Next x

critstr = Left(&quot;critstr&quot;, Len(&quot;critstr&quot;) - 5)
Me.picList.RowSource = &quot;SELECT Distinct lacIbase, Mutation, Count(Mutation) As [Number Observed] FROM The_Big_Query WHERE &quot; & critstr & &quot; group by lacibase, mutation&quot;
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

 
critstr = Left(&quot;critstr&quot;, Len(&quot;critstr&quot;) - 5)

remove the &quot;'s

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top