D
DubboPete
Hi all,
I have a form which is the basis for a report. On the form I have a
list of facilities in Combo38. Then, once a facility has been
selected, there are six choices in a frame to further filter down the
records.
The filter is supposed to find all records where, for instance, the
facility is Drug and Alcohol Unit, and the category is "Continuum Of
Care".
Once selected, I then click a command button to preview the filtered
report. The only problem is, the frame's filter part is not
'filtering' ! The combo box filter seems to be working, but I see all
records for the particular facility, not just the selected choice in
the frame.
Here's the code:
Private Sub Command21_Click()
Dim strField As String
Dim strWhere As String
Select Case Me.[Frame9]
Case 1
strField = "[Continuum Of Care]"
Case 2
strField = "[Leadership & Management]"
Case 3
strField = "[Human Resources Management]"
Case 4
strField = "[Information Management]"
Case 5
strField = "[Safe Practice & Environment]"
Case 6
strField = "[Service Delivery (Area Office only)]"
End Select
strWhere = BuildCriteria("FacilityID", dbLong, Me.Combo38.Value)
If strField = "Yes" Then
strWhere = strWhere & " AND " & BuildCriteria(strField,
dbBoolean, True)
End If
DoCmd.OpenReport "RptEquipSum1", acViewPreview, , strWhere
End Sub
Can anybody see any flaws in the code, and if not, why aint it
filtering properly??
DubboPete
I have a form which is the basis for a report. On the form I have a
list of facilities in Combo38. Then, once a facility has been
selected, there are six choices in a frame to further filter down the
records.
The filter is supposed to find all records where, for instance, the
facility is Drug and Alcohol Unit, and the category is "Continuum Of
Care".
Once selected, I then click a command button to preview the filtered
report. The only problem is, the frame's filter part is not
'filtering' ! The combo box filter seems to be working, but I see all
records for the particular facility, not just the selected choice in
the frame.
Here's the code:
Private Sub Command21_Click()
Dim strField As String
Dim strWhere As String
Select Case Me.[Frame9]
Case 1
strField = "[Continuum Of Care]"
Case 2
strField = "[Leadership & Management]"
Case 3
strField = "[Human Resources Management]"
Case 4
strField = "[Information Management]"
Case 5
strField = "[Safe Practice & Environment]"
Case 6
strField = "[Service Delivery (Area Office only)]"
End Select
strWhere = BuildCriteria("FacilityID", dbLong, Me.Combo38.Value)
If strField = "Yes" Then
strWhere = strWhere & " AND " & BuildCriteria(strField,
dbBoolean, True)
End If
DoCmd.OpenReport "RptEquipSum1", acViewPreview, , strWhere
End Sub
Can anybody see any flaws in the code, and if not, why aint it
filtering properly??
DubboPete