Results 1 to 6 of 6
  1. #1
    d9pierce1 is offline Expert
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828

    REmoving auto form filter on dbl clk event?

    Hi all,
    I have a list box that has a dblclk event to open form to go to specific record. when this happens it filters the form, how do i unfilter this without having to click? I just want it to go to that record.
    Code:
    Private Sub PartnerLst_DblClick(Cancel As Integer)
    DoCmd.OpenForm "CompanyFrm", , , "CompanyID= " & Me.PartnerLst.Column(1) & " "
    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
    53,771
    If you simply unfilter, focus will move to first record.

    I would pass criteria to the opening form via OpenArgs and code behind that form goes to record using RecordsetClone, FindFirst, Bookmarks.

    Is listbox UNBOUND?
    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.

  3. #3
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828
    Hi,
    ListBox is unbound populated by qry. with a criteria of [Forms]![CompanyFrm]![CompanyID]

  4. #4
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828
    Company - Copy.zip
    Here is a copy of the db
    Thanks

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    CompanyFrm is already open so code to open itself makes no sense.

    The listbox lists partners associated with the main form record - you want to search for CompanyID that matches the PartnerID on main form and therefore see that partner's partners?

    Code:
    Private Sub PartnerLst_DblClick(Cancel As Integer)
    With Me.RecordsetClone
         .FindFirst "CompanyID=" & Me.PartnerLst.Column(1)
         If Not .NoMatch Then Me.Bookmark = .Bookmark
    End With
    End Sub
    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.

  6. #6
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828
    thank you,
    Again!

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

Similar Threads

  1. Replies: 7
    Last Post: 12-04-2018, 07:27 AM
  2. AfterUpdate() Event To Filter Sub Form
    By chalupabatman in forum Programming
    Replies: 8
    Last Post: 11-06-2017, 01:36 PM
  3. On Click event filter By checkbox = True
    By nick404 in forum Programming
    Replies: 14
    Last Post: 06-05-2015, 03:08 PM
  4. auto fill event procedure
    By alchezhira in forum Access
    Replies: 1
    Last Post: 01-10-2014, 09:03 AM
  5. Replies: 7
    Last Post: 03-15-2011, 11:14 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