PC Review


Reply
Thread Tools Rate Thread

autofilter next and previous record problem

 
 
Pierre
Guest
Posts: n/a
 
      21st Dec 2007
Hi experts,

I have a problem after using autofilter.
After useing autofilter i use the following code for going to the next or
previous records

next:
Private Sub but_next_Click()
Do
Set filterrange = filterrange.Offset(1, 0)
Loop While filterrange.EntireRow.Hidden = True
Call textboxen_vullen 'code to fill a lot of textboxes
End Sub

previous
Private Sub but_next_Click()
Do
Set filterrange = filterrange.Offset(-1, 0)
Loop While filterrange.EntireRow.Hidden = True
Call textboxen_vullen 'code to fill a lot of textboxes
End Sub

The problem is that there is no limit.
If i click previous enough times, i get an error message.
I would like it to stop at the first record of the filtered set

Also if i click the "next"button i want it to stop at the last record of the
filtered list

Can you please help me with this ?
Thanks,
Pierre





 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: adding a new record and saving it, moving to next, previous record using a form in Access 2007 John W. Vinson Microsoft Access 1 24th Jun 2010 10:03 PM
Continuing problem populating userform from a previous record Dooley007 Microsoft Excel Programming 7 20th Dec 2006 03:19 PM
Current Record Count, Previous Record #, Add New Record =?Utf-8?B?Um9iZXJ0IE51c3ogQCBEUFM=?= Microsoft Access Forms 0 15th Feb 2005 08:35 PM
Problem carrying a value from the previous record to a new record Amit Microsoft Access Form Coding 1 13th May 2004 04:56 PM
Fill record with Data from Previous Record Automatically - Knowledge Base Articl Michael Doyle Microsoft Access Forms 1 30th Oct 2003 03:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:18 AM.