472,093 Members | 2,520 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,093 software developers and data experts.

Filter Report Using Pop Up Form

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
  6.  
  7. strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "]" & "=" & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And "
  8.  
  9. End If
  10. Next
  11.  
  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
1 5396
NeoPa
32,496 Expert Mod 16PB
Cara,

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.

Similar topics

reply views Thread by CSDunn | last post: by
8 posts views Thread by dick | last post: by
16 posts views Thread by Nhmiller | last post: by
1 post views Thread by lorirobn | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.