Results 1 to 2 of 2
  1. #1
    anoob is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    60

    Double Sort?

    This is probably a stupid question.

    I have an ApplyFilter action applied to a button - lets just say it shows all expenses from a table - but is there a way to make this ONLY apply to the current filtered records the form is showing?

    For example, if I have 100 transactions in 2010 and I filter out all the transactions between July and December. Not I have 50 records showing.

    Is there a way to make my my filter expenses action filter the 50 remaining records?

    Right now it's just very simple set to this:
    Code:
    [Expenses]>0
    I'm wondering if there is something similar to this I can use:


    Code:
    [Expenses].CurrentRecords>0
    Many thanks.
    I know this is a forum but sorry for all the questions - this is saving me so much time though and I appreciate all the feedback.

  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 anoob View Post
    This is probably a stupid question.

    I have an ApplyFilter action applied to a button - lets just say it shows all expenses from a table - but is there a way to make this ONLY apply to the current filtered records the form is showing?

    For example, if I have 100 transactions in 2010 and I filter out all the transactions between July and December. Not I have 50 records showing.

    Is there a way to make my my filter expenses action filter the 50 remaining records?
    No.

    There are two ways to select records for a form. The first is to use all records in a table or query (say 150). Then set a filter to limit the records displayed. If you want to do additional filtering, you have to get the current filter, then add the new filter condition. For example, if the filter is

    Code:
    TransDate between #7/1/2010# and #12/31/2010#
    and you want to have an additional filter of expenses >0, the filter statement would be

    Code:
    ([TransDate] Between #7/1/2010# and #12/31/2010#) AND [Expenses] >0
    The base number of records is still 150.


    The second way is to limit the records returned to the form. Instead of returning all records, the WHERE clause for the query would be

    Code:
    WHERE [TransDate] Between #7/1/2010# And #12/31/2010#
    Instead of returning 150 records (see above), the where clause would limit the records returned to 100. Then, if you wanted to filter by expenses >0, the filter string would only be

    Code:
    [Expenses] >0
    .
    .
    I know this is a forum but sorry for all the questions - this is saving me so much time though and I appreciate all the feedback.
    Actually, that is what this forum is for - to answer questions about Access.

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

Similar Threads

  1. Currency Vs Double
    By Mclaren in forum Database Design
    Replies: 1
    Last Post: 08-12-2010, 05:38 PM
  2. switching int/double
    By giladweil in forum Access
    Replies: 2
    Last Post: 07-05-2010, 01:13 AM
  3. Append query double criteria
    By Gerry in forum Queries
    Replies: 0
    Last Post: 03-23-2010, 03:55 PM
  4. How to sort by three sort orders
    By captgnvr in forum Access
    Replies: 4
    Last Post: 11-09-2009, 07:30 AM
  5. double booked entries
    By qbc in forum Access
    Replies: 3
    Last Post: 08-28-2009, 10:30 AM

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