Results 1 to 4 of 4
  1. #1
    rlsublime is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2012
    Posts
    58

    One filter for 3 Queries in Union Query

    I currently have a union query with 3 queries linked to it. There is a “Start’ and “End” date filter for all three queries. The start and end date filters pop up three times(One for each query). I am trying to only get it to pop up once but to apply the filter to all three queries in the Query Union.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by rlsublime View Post
    I currently have a union query with 3 queries linked to it. There is a “Start’ and “End” date filter for all three queries. The start and end date filters pop up three times(One for each query). I am trying to only get it to pop up once but to apply the filter to all three queries in the Query Union.
    Put 2 text boxes on a form. Modify the 3 queries to look at the text boxes. You will have to concatenate the controls in each of the queries.

    ie ..... WHERE StartDate = #" & Forms!SomeForm.dtStart & "# AND EndDate = #" & Forms!SomeForm.dtEnd 7 "#"

    (dtStart is the name of the control for the start date
    dtEnd is the name of the control for theend date.)

  3. #3
    rlsublime is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2012
    Posts
    58
    Thanks. I am fairly new to access so I might need a little additional help. So far, I created a form named DateFilter with two text boxes and named one dtStart and the other dtEnd. I then put the following “WHERE StartDate = #" & Forms!DateFilter.dtStart & "# AND EndDate = #" & Forms!DateFilter.dtEnd & "#" in each of the three queries under the date that is to be filtered. Should I create some king of button in the form to execute the UNION query?

    Thanks

  4. #4
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    How are you executing the query now? As long as the form is open and the date text boxes have entries, you can execute the query as normal.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Union Queries
    By tarhim47 in forum Queries
    Replies: 6
    Last Post: 05-26-2011, 12:20 PM
  2. Union Queries when Splitting Database
    By jaypoppin in forum Queries
    Replies: 3
    Last Post: 03-04-2011, 06:06 PM
  3. Union Query
    By jlclark4 in forum Queries
    Replies: 3
    Last Post: 02-25-2011, 08:21 PM
  4. Filter for Multiple Queries/Combo Box
    By finance600man in forum Access
    Replies: 3
    Last Post: 08-09-2010, 06:31 AM
  5. Replies: 3
    Last Post: 05-21-2010, 03:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums