B
Brook
Good Day All,
I have a form that I use to filter a report with 5 options the user has to
select from drop down cboboxes. As it is set up and working now, if the user
selects option1 (Size), and option2(Colour) the code only files those files
with the size and colour chosen. I would like for the filter to include all
colours for the size chosen. Can anyone help?
Below is my code for my cmd buttons:
Private Sub Command28_Click()
Dim strSQL As String, intCounter As Integer
'Build SQL String
For intCounter = 1 To 5
If Me("Filter" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " & " =
" & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And "
End If
Next
If strSQL <> "" Then
'Strip Last " And "
strSQL = Left(strSQL, (Len(strSQL) - 5))
'Set the Filter property
Reports![rptcheckingaccount].Filter = strSQL
Reports![rptcheckingaccount].FilterOn = True
Else
Reports![rptcheckingaccount].FilterOn = False
End If
End Sub
Private Sub Command29_Click()
Dim intCouter As Integer
For intCouter = 1 To 5
Me("Filter" & intCouter) = ""
Next
End Sub
Private Sub Command30_Click()
DoCmd.Close acForm, Me.Form.Name
End Sub
Thanks,
Brook
I have a form that I use to filter a report with 5 options the user has to
select from drop down cboboxes. As it is set up and working now, if the user
selects option1 (Size), and option2(Colour) the code only files those files
with the size and colour chosen. I would like for the filter to include all
colours for the size chosen. Can anyone help?
Below is my code for my cmd buttons:
Private Sub Command28_Click()
Dim strSQL As String, intCounter As Integer
'Build SQL String
For intCounter = 1 To 5
If Me("Filter" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " & " =
" & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And "
End If
Next
If strSQL <> "" Then
'Strip Last " And "
strSQL = Left(strSQL, (Len(strSQL) - 5))
'Set the Filter property
Reports![rptcheckingaccount].Filter = strSQL
Reports![rptcheckingaccount].FilterOn = True
Else
Reports![rptcheckingaccount].FilterOn = False
End If
End Sub
Private Sub Command29_Click()
Dim intCouter As Integer
For intCouter = 1 To 5
Me("Filter" & intCouter) = ""
Next
End Sub
Private Sub Command30_Click()
DoCmd.Close acForm, Me.Form.Name
End Sub
Thanks,
Brook