Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    16

    Unanswered: cancel a filter in a form

    I am a beginner user of MS Access and Visual Basic.

    I have a problem:

    When I try to open a new form with a filter (ID=4) the form opens and everything is OK. But I don't know how to cancel this filter without loosing the position of my active record (with ID=4) in a way that when I press the "next record" button my current position will be ID=5.

    Now I use 'FilterOn = False' and when I press the "next record" button my Form resets and active record is 1.

    I would be grateful for any advices. Sorry for simple question.

  2. #2
    Join Date
    Feb 2004
    Posts
    142

    Re: cancel a filter in a form

    Originally posted by pdudzik
    I am a beginner user of MS Access and Visual Basic.

    I have a problem:

    When I try to open a new form with a filter (ID=4) the form opens and everything is OK. But I don't know how to cancel this filter without loosing the position of my active record (with ID=4) in a way that when I press the "next record" button my current position will be ID=5.

    Now I use 'FilterOn = False' and when I press the "next record" button my Form resets and active record is 1.

    I would be grateful for any advices. Sorry for simple question.
    On the next record button add this
    Dim lngID as long
    lngID = control that holds the ID number
    Me.filterOn = false
    Me.RecordsetClone.FindFirst "[ID] = " & lngID
    Me.Bookmark = Me.RecordsetClone.Bookmark
    DoCmd.GoToRecord , , acNext
    KC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •