Results 1 to 4 of 4
  1. #1
    jmk909er is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Location
    San Diego, CA
    Posts
    39

    Previous and next button on form that applies filter

    I am trying to make my own previous and next button on my form and I also need to change the filter when this happens. The filter when the form opens is [Reference Number] = "" and when I press the next button I want the filter to change to [Completed Projects] = 0



    I put in:

    Private Sub Command79_Click()
    Me.Filter = "[Project Completed] = 0"
    DoCmd.GoToRecord , , acNext
    End Sub

    And it kinda works but wont go past record 2

    How can I write it in VBA? I have tried many things and nothing seems to work. Form is called frmProjects

    Any Ideas?? Thanks, Joe

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    You are fixed at 0. You need a technique to change that value. Not clear if it is sequencial or not....or otherwise how the db knows which next value to go to next..... but if you get that in there it should work.

    Hope this helps.

  3. #3
    jmk909er is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Location
    San Diego, CA
    Posts
    39
    My [Completed Projects] = 0 refers to a yes/no so what I am trying to filter for is all of my projects that are not completed. I noticed that if I set the filter to Me.Filter = no that it clears the previous filter and allows me to click through records with the record selector which is what I want, it's just that it is giving me "not completed" and "completed"

  4. #4
    jmk909er is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Location
    San Diego, CA
    Posts
    39
    Decided to go about this another way

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

Similar Threads

  1. Button hiding when filter on
    By rstonehouse in forum Forms
    Replies: 2
    Last Post: 08-25-2010, 06:24 AM
  2. Filter button
    By tomeem in forum Access
    Replies: 0
    Last Post: 08-28-2009, 12:50 AM
  3. "Previous Month" button
    By allochthonous in forum Programming
    Replies: 3
    Last Post: 09-10-2006, 12:15 PM
  4. command button to filter a subform issue -
    By countdrako in forum Forms
    Replies: 1
    Last Post: 12-09-2005, 11:58 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