Results 1 to 5 of 5
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Case Select Code DoCmd.ShowAllRecords Not Working

    I have a combo with a list of selections and one of them is to show all records but it does not show all of the record. Here is the code.

    Select Case Me.Combo63
    Case "All"
    DoCmd.ShowAllRecords
    Me.Requery
    End Select


    Me.FilterOn = True
    Last edited by burrina; 01-05-2013 at 02:59 PM. Reason: forgot combo name.

  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,521
    Is that all the code? The last line will apply a filter.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Select Case Me.Combo63
    Case "Today"
    Me.Filter = "[nextschddte]=Date()"
    Case "This Week"
    Me.Filter = "[nextschddte] BETWEEN Date()-7 AND Date()"
    Case "Last Week"
    Me.Filter = "[nextschddte] BETWEEN Date()-14 AND Date()-7"
    Case "Last Month"
    Me.Filter = "Format([nextschddte],'mmyyyy') = Format(DateAdd('m',-1,Date()),'mmyyyy')"
    Case "Next Month"
    Me.Filter = "Format([nextschddte],'mmyyyy') = Format(DateAdd('m',+1,Date()),'mmyyyy')"
    Case "All"
    DoCmd.ShowAllRecords
    Me.Requery
    End Select
    Me.FilterOn = True
    End Sub

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have never used ShowAllRecords and not finding much about it.

    Maybe this will work:
    DoCmd.RunCommand acCmdRemoveAllFilters
    or
    DoCmd.RunCommand acCmdRemoveFilterSort

    I just tested all three and they all worked.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Yep, that worked,,, Thanks Again.

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

Similar Threads

  1. VBA for SELECT CASE logic
    By rlsublime in forum Programming
    Replies: 1
    Last Post: 12-04-2012, 09:09 PM
  2. select case problem
    By Mclaren in forum Programming
    Replies: 3
    Last Post: 11-17-2011, 01:28 PM
  3. select case or else if for unhiding
    By nichmeg in forum Programming
    Replies: 3
    Last Post: 10-30-2011, 09:30 AM
  4. Select Case vs Dlookup
    By BRV in forum Programming
    Replies: 1
    Last Post: 10-28-2011, 03:18 PM
  5. Help with Select Case statement
    By focosi in forum Access
    Replies: 4
    Last Post: 08-09-2011, 12:01 AM

Tags for this Thread

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