Z
ZIMMJE
I have a list box that you can select a group name from. When you click
print preview I then have a Graph (that is fed by
qryGroupSummary_AreaSummary) that should display only the group that was
selected from the list. Below is what I have so far. In Debug everything
looks correct except the where statement. the strRptFilter contaions the
field I select but I am not sure how to have that selection select the
correct records in the qry that feeds my graph.
Please help I am sure I am making this to difficult.
Private Sub Command7_Click()
Dim strRptFilter As String
Dim lngLoop As Long
strRptFilter = ""
For lngLoop = 0 - [PickList].ColumnHeads To [PickList].ListCount - 1
If [PickList].Selected(lngLoop) = True Then _
strRptFilter = strRptFilter & _
[PickList].ItemData(lngLoop) & " Or "
Next lngLoop
If Len(strRptFilter) > 4 Then strRptFilter = Left(strRptFilter,
Len(strRptFilter) - 4)
DoCmd.OpenReport "chtHSA_Group", acViewPreview, ,
[qryGroupSummary_AreaAummary].[GROUPS] = strRptFilter
print preview I then have a Graph (that is fed by
qryGroupSummary_AreaSummary) that should display only the group that was
selected from the list. Below is what I have so far. In Debug everything
looks correct except the where statement. the strRptFilter contaions the
field I select but I am not sure how to have that selection select the
correct records in the qry that feeds my graph.
Please help I am sure I am making this to difficult.
Private Sub Command7_Click()
Dim strRptFilter As String
Dim lngLoop As Long
strRptFilter = ""
For lngLoop = 0 - [PickList].ColumnHeads To [PickList].ListCount - 1
If [PickList].Selected(lngLoop) = True Then _
strRptFilter = strRptFilter & _
[PickList].ItemData(lngLoop) & " Or "
Next lngLoop
If Len(strRptFilter) > 4 Then strRptFilter = Left(strRptFilter,
Len(strRptFilter) - 4)
DoCmd.OpenReport "chtHSA_Group", acViewPreview, ,
[qryGroupSummary_AreaAummary].[GROUPS] = strRptFilter