captainlove
captainlove
- Local time
- Today, 16:32
- Joined
- Apr 18, 2008
- Messages
- 39
I have a main form that has two combo boxes, txtuser and txtqcp. My subform has revision date and revision text controls
I want to filter revision date and revision based on the selection I make for a txtuser and txtqcp(i.e user BP and qcp 10000)
so that on my sub form it would have the revision date and revision that applies only to a particular user.
This is the code I got off microsoft site , but I need to twick it to suite my purpose can anyone hep
My controls are txtrevisiondate, txtrevision
Private Sub Set_Filter_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![rptCustomers].Filter = strSQL
Reports![rptCustomers].FilterOn = True
End If
End Sub
Thanks
I want to filter revision date and revision based on the selection I make for a txtuser and txtqcp(i.e user BP and qcp 10000)
so that on my sub form it would have the revision date and revision that applies only to a particular user.
This is the code I got off microsoft site , but I need to twick it to suite my purpose can anyone hep
My controls are txtrevisiondate, txtrevision
Private Sub Set_Filter_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![rptCustomers].Filter = strSQL
Reports![rptCustomers].FilterOn = True
End If
End Sub
Thanks