Reposting with more about what i need since it seemed unclear to the previous person that replied to my post.
what can i add to the code below that will also filter the report by 3 unbound check boxes. My employees have 3 required items to obtain before they are certified to travel and i want to be able to filter my report based on any 1, 2 or all 3 and mix and match the requirements. The code below works great for Employee type as an option group and Office location as a multi select list box. I have done internet search every which way and scoured other example databases and i can't find the coding that successfully adds in 3 unbound check boxes. The 3 values in my table, the report is based on, are also checkbox yes/no values.
The green commented items work fine to filter the report.. only posting so you can see the total of what i am using.
Private Sub cmdApplyFilter_Click()
Dim varItem As Variant
Dim strChkbox As String <do i need 3 of these? like chkbox1, chkbox2 ect?
Dim strOffice As String
Dim strEmployeetype As String
Dim strFilter As String
' Check that the report is open
If SysCmd(acSysCmdGetObjectState, acReport, "Travel1") <> acObjStateOpen Then
DoCmd.OpenReport "Travel1", acPreview
' Build criteria string from Check boxes
' Build criteria string from lstOffice listbox
For Each varItem In Me.lstOffice.ItemsSelected
strOffice = strOffice & ",'" & Me.lstOffice.ItemData(varItem) _
If Len(strOffice) = 0 Then
strOffice = "Like '*'"
strOffice = Right(strOffice, Len(strOffice) - 1)
strOffice = "IN(" & strOffice & ")"
' Build criteria string from fraemployeetype option group
Select Case Me.fraemployeetype.Value
strEmployeetype = "='OFFICER'"
strEmployeetype = "='SUPERVISOR'"
strEmployeetype = "Like '*'"
' Build filter string
strFilter = "[PORT] " & strOffice & " AND [Employeetype] " & strEmployeetype
' Apply the filter and switch it on
.Filter = strFilter
.FilterOn = True