Results 1 to 5 of 5
  1. #1
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88

    Filtered Records Wont Stay Filtered

    I have two options in my DB...InCollection and Wishlist...its for a game collection...anyway, when the page loads its set to InCollection but if I edit a Wishlist item and hit the Save button the entire page gets stuck on Wishlist the next time I open it. I have to click on InCollection then Save to restore it. I have the code below and it does this anyway. Any help is appreciated. Thnx.

    Private Sub Form_Load()
    DoCmd.SetFilter [InCollection] = True
    DoCmd.SetOrderBy "ConsoleName, ASC, Games, ASC"
    End Sub



    I've also used Me.FilterOn = True and Me.Filter = "InCollection"

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    The filter is a string, so try

    Me.Filter = "InCollection = True"
    Me.FilterOn = True

    I'm assuming that's a Yes/No field.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,362
    This might shed some light on why your setting isn't saved https://ss64.com/access/setfilter.html (note 2nd last paragraph before Example).
    SetFilter was introduced in 2010 for dealing with web based data AFAIK. It's not for what you're doing.

  4. #4
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88
    Quote Originally Posted by pbaldy View Post
    The filter is a string, so try

    Me.Filter = "InCollection = True"
    Me.FilterOn = True

    I'm assuming that's a Yes/No field.
    You are a FREAKING GENIUS!!!! it worked! Thanks!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I'm a legend...in my own mind.

    Glad it worked for you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Filtered records
    By hinchi1 in forum Access
    Replies: 42
    Last Post: 11-29-2017, 03:54 AM
  2. Dcount records from a filtered form
    By charly.csh in forum Access
    Replies: 6
    Last Post: 11-20-2014, 01:14 PM
  3. How to get count of filtered records
    By DBDave in forum Queries
    Replies: 2
    Last Post: 11-03-2014, 02:07 PM
  4. Filtered Report from filtered datasheet form
    By gemadan96 in forum Reports
    Replies: 7
    Last Post: 01-03-2014, 05:12 PM
  5. Open form to filtered records
    By ducecoop in forum Access
    Replies: 3
    Last Post: 10-22-2010, 10:53 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