By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,484 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

Filter Report Using Pop Up Form

P: 5
Hi There!

Hoping you are able to help me with a filtering scenario:

I have created a pop up form (Filter) to filter a report (Open Issues), which currently has a number of combo boxes which apply the filters to the fields in the report.

I would like to use this form to filter the report within a date range (Raised Date From and Raised Date To), using unbound text boxes, without having to specify the criteria within the report's underlying query (query is used to create more that one report).

The following is the code I have written for the 5 current combo boxes (Filter1 - Filter 5) I have on the pop up form:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Set_Filter_Click()
  2. Dim strSQL As String, intCounter As Integer
  3. 'Build SQL String
  4. For intCounter = 1 To 5
  5. If Me("Filter" & intCounter) <> "" Then
  7. strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "]" & "=" & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And "
  9. End If
  10. Next
  12. If strSQL <> "" Then
  13. 'Strip Last " And ".
  14.     strSQL = Left(strSQL, (Len(strSQL) - 5))
  15.     'Set the Filter property
  16. Reports![Open Issues].Filter = strSQL
  17. Reports![Open Issues].FilterOn = True
  18. End If
  19. End Sub
How do I add this date range filter to my pop up form?

Any assistance would be greatly appreciated!
Sep 7 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 31,661

I'm sorry I didn't find this thread earlier.
There is an article that goes through how to do this sort of thing (Example Filtering on a Form.).
If you haven't given up on theScripts already, check it out and let me know if you still have questions.
Nov 28 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.