Hi all,
I have a combo box with an "All" option, but I'm having trouble figuring out why it fails to return any records. I'm using a search command button to filter the records. I've attached my database and the specific code I'm using is below. I really, really appreciate any help that can be given!
Cheers,
dkinnz
combo box Row Source:
VBA code:
I have a combo box with an "All" option, but I'm having trouble figuring out why it fails to return any records. I'm using a search command button to filter the records. I've attached my database and the specific code I'm using is below. I really, really appreciate any help that can be given!
Cheers,
dkinnz
combo box Row Source:
Code:
SELECT DISTINCT qryFilterGroup.[Group Name] FROM qryFilterGroup UNION SELECT "(All)" as [Group Name] From qryFilterGroup ORDER BY qryFilterGroup.[Group Name];
VBA code:
Code:
Private Sub cmdSearch_Click()
Me.subfrmFilter1.Form.RecordSource = "SELECT * FROM qryFilterGroup " & FilterIt
Me.subfrmFilter1.Requery
End Sub
Private Function FilterIt() As Variant
Dim varFam As Variant
If Me.cboGroup > 0 Then
varFam = "[Group Name] = '" & Me.cboGroup & "'"
End If
FilterIt = "Where " & varFam
End Function