Results 1 to 2 of 2
  1. #1
    Delta729 is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Location
    Los Angeles
    Posts
    95

    Two Form Filter

    My form has two form filters. However, only the Region seems to be working. (This is just the start of database I am trying to create. It will have a lot more in the future.)
    The vendor form filter doesn't seem to do anything at all except refresh the screen. Could someone let me know how to fix that.

    Here is the VBA code I have so far:

    Option Compare Database


    Private Sub cboFilterRegion_AfterUpdate()
    Me.Filter = "RegID = " & Me.cboFilterRegion
    Me.FilterOn = True
    Me.Requery
    End Sub


    Private Sub cboFilterVendor_AfterUpdate()
    Me.Filter = "VenID = " & Me.cboFilterVendor
    Me.Filter = True
    Me.Requery
    End Sub


    Private Sub cmdClearFilter_Click()
    Me.FilterOn = False
    Me![cboFilterRegion] = Null
    Me.Requery
    End Sub


    Private Sub cmdClearVendor_Click()
    Me.FilterOn = False
    Me![cboFilterVendor] = Null
    Me.Requery
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Do you want to combine RegID and VenID criteria?

    Try using Me.FilterOn = False to undo filter before applying a new filter.

    Me.Requery should not be needed.
    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.

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

Similar Threads

  1. Replies: 9
    Last Post: 02-24-2015, 11:19 AM
  2. Filter By Form and Apply Filter Buttons
    By JustLearning in forum Forms
    Replies: 13
    Last Post: 02-18-2015, 01:01 PM
  3. Replies: 5
    Last Post: 02-07-2013, 12:21 PM
  4. Replies: 1
    Last Post: 08-16-2012, 01:51 PM
  5. Replies: 28
    Last Post: 03-08-2012, 06:47 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