Hi everyone,
So Some one helped me hevely with the original mod That I am tring to alter work with hear. I want it to do the same thing as the originol just on a difrint field and work with diffrint forms in the same database. I have set up a new form to search from called Categorysearch and a new form to open it in called frmcategory. Here is what I have changed. CategoryT is the list for the Main Form
Public Function TestFilter() As Byte
Dim ctl2 As Control
Dim strWhere2 As String
For Each ctl2 In Forms!Categorysearch.Form
If ctl2.ControlType = acCheckBox Then
If ctl2.Value = True Then
strWhere2 = strWhere2 & "'" & ctl2.Controls(0).Caption & "',"
End If
End If
Next
If strWhere2 > "" Then
Forms!Categorysearch.txtCounties = "Lookup_Category.CategoryT In(" & strWhere2 & ")"
Else
Forms!Categorysearch.txtCategory = Null
End If
End Function
I dont know what I am doing wrong. If you could help me out and explain it that would be much appreciated so that I can learn from my mistakes.
So Some one helped me hevely with the original mod That I am tring to alter work with hear. I want it to do the same thing as the originol just on a difrint field and work with diffrint forms in the same database. I have set up a new form to search from called Categorysearch and a new form to open it in called frmcategory. Here is what I have changed. CategoryT is the list for the Main Form
Public Function TestFilter() As Byte
Dim ctl2 As Control
Dim strWhere2 As String
For Each ctl2 In Forms!Categorysearch.Form
If ctl2.ControlType = acCheckBox Then
If ctl2.Value = True Then
strWhere2 = strWhere2 & "'" & ctl2.Controls(0).Caption & "',"
End If
End If
Next
If strWhere2 > "" Then
Forms!Categorysearch.txtCounties = "Lookup_Category.CategoryT In(" & strWhere2 & ")"
Else
Forms!Categorysearch.txtCategory = Null
End If
End Function
I dont know what I am doing wrong. If you could help me out and explain it that would be much appreciated so that I can learn from my mistakes.