Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Filter a form's RecordSource


    Do I recall correctly that a form's RecordSource can't be filtered with simple Filter method? The "early development code" below does not take any effect on the form's RecordSource. (strLastReconcile is a string variable global to the form's module.)

    Code:
    Private Sub cmdShowAll_Click()
    Me.RecordSource = "QDepositsAll"
        If strLastReconcile <> "NEVER" Then
            Me.Filter = "[TDate] >= " & strLastReconcile
            Me.FilterOn = True
        End If
    
    Me.Requery
    End Sub

  2. #2
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    DUH! (Sometimes I hate date strings)

    Code:
    Private Sub cmdShowAll_Click()
    Me.RecordSource = "QDepositsAll"
        If strLastReconcile <> "NEVER" Then
            Me.Filter = "[TDate] >= #" & strLastReconcile & "#"
            Me.FilterOn = True
        End If
    
    Me.Requery
    End Sub

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You're probably tired from shoveling snow.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    The most we've seen in 5 or 6 years.

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

Similar Threads

  1. open form and set recordsource
    By vicsaccess in forum Forms
    Replies: 4
    Last Post: 06-20-2016, 08:39 PM
  2. RecordSource Property of a form
    By mkc80 in forum Access
    Replies: 4
    Last Post: 08-11-2012, 05:43 PM
  3. Replies: 8
    Last Post: 05-10-2012, 10:57 AM
  4. Update recordsource of one field on a form
    By TinaCa in forum Programming
    Replies: 1
    Last Post: 03-06-2012, 06:56 PM
  5. Replies: 8
    Last Post: 08-08-2011, 02:05 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