Not sure if this it what you are looking for but I have a form with several checkboxes and comboboxes. If the checkbox = true then I pass the value in the combobox to the report using the where condition.
Dim sWHERE As String
If chklengthID Then
sWHERE = sWHERE & " AND lengthvalue = " & cbolengthID
End If
If chksupplierID Then
sWHERE = sWHERE & " AND suppliercode = """ & cbosupplierID & """"
End If
If chkcolorID Then
sWHERE = sWHERE & " AND colorcode = """ & cbocolorID & """"
End If
If chkthicknessid Then
sWHERE = sWHERE & " AND thicknesscode = """ & cbothicknessid & """"
End If
If chkstatus Then
sWHERE = sWHERE & " AND status = """ & cbostatus & """"
End If
If chkheavy Then
sWHERE = sWHERE & " AND thicknesscode <> """ & "1438" & """"
End If
If sWHERE <> "" Then sWHERE = Mid$(sWHERE, 6)
If EntriesValid = False Then Exit Sub
DoCmd.OpenReport "Greenstone inventory", acViewPreview, , sWHERE
End Sub
Mike
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.