ByronJohnson
MIS
I am new to access and can't figure out how to do this. I have six combo boxes that the user choses from. When 0 or all combo boxes are selected, records are displaed in a list box pertaining to what was selected. Now I want it so the when the user selects fields in the combo boxes the records will keep being added in the list box and not being refreshed everytime. If any one has any insight I would greatly appreciate it.
Here is my code
Private Sub cmdAdd_Click()
Dim critstr As String
Dim x As Integer
For x = 1 To 6 'Loop 6 Times
If Me("combo" & x) <> "" Then
critstr = critstr & Me("combo" & x).Tag & " = '" & Me("combo" & x) & "' And "
End If
Next x
If Len(critstr) > 5 Then
critstr = Left(critstr, Len(critstr) - 5)
End If
Me.picList1.RowSource = "SELECT Distinct AnimalID, ChemName, Dose, BluePlaque FROM Generate1 WHERE " & critstr & ""
End Sub
Thanks,
Byron
Here is my code
Private Sub cmdAdd_Click()
Dim critstr As String
Dim x As Integer
For x = 1 To 6 'Loop 6 Times
If Me("combo" & x) <> "" Then
critstr = critstr & Me("combo" & x).Tag & " = '" & Me("combo" & x) & "' And "
End If
Next x
If Len(critstr) > 5 Then
critstr = Left(critstr, Len(critstr) - 5)
End If
Me.picList1.RowSource = "SELECT Distinct AnimalID, ChemName, Dose, BluePlaque FROM Generate1 WHERE " & critstr & ""
End Sub
Thanks,
Byron