Results 1 to 2 of 2
  1. #1
    injanib is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    67

    Beginning and End of Filter

    Hello,

    I have custom navigation buttons on my form. I use the OnCurrent event of the form to enable or disable the next and previous buttons when the form is on the first or last record. I use the (me.currentreocrd=1) and (me.currentrecord=recordset.recordcount) to mark the beginning and end of the records.
    The problem is that when the filter is on, this doesn't behave as I intend it to do, and I understand why it shouldn't. What I am thinking is to add an If statement for Me.FilterOn=True, and then mark the beginning and end of the filter. Is this possible? Please help. Thanks in advance.

  2. #2
    injanib is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    67
    Ok, never mind. I got it working. the Me.CurrentRecord=1 and Me. CurrentRecord =Recordset.RecordCount should mark the beginning and end of the filtered recorda as well. But for some reason, if there is only one record found it gets confused since that record is the first and last record. There fore it doesn't fire the underlying code as it should and enables the next button which then moves to a new record if clicked. Maybe there is better way to handle this, but I added an if statement so that if the record count as the result of the filter is 1, then it should disable my next button.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-05-2011, 12:46 PM
  2. Beginning Design Help
    By GenericHbomb in forum Database Design
    Replies: 30
    Last Post: 08-20-2010, 09:41 AM
  3. How do I filter on this ?
    By _Chris_ in forum Access
    Replies: 7
    Last Post: 08-12-2010, 08:34 PM
  4. Filter on #Num!
    By marley in forum Access
    Replies: 5
    Last Post: 07-28-2010, 06:59 AM
  5. Calculating Beginning and Ending page numbers
    By sabraham in forum Access
    Replies: 3
    Last Post: 01-07-2010, 12:36 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