display set of records in a form with previous and next button

  • Thread starter Thread starter jophy j via OfficeKB.com
  • Start date Start date
J

jophy j via OfficeKB.com

In a worksheet around 500 records are there -Employee number,employee name,
Joining date

I need to display 5 records on the form depending on the date criteria. Let's
say Joining date from 1st jan 05 to 30th Jan 05. There are 25 records
satisfying this criteria and need to dispaly in 5 records at a time on the
form. Once I click on the next button it should show next 5records satisfying
this criteria, Same sa if i click on the previous button it should display
the previous 5 records which satisfying this criteria.

I have created 20 textboxes on the form like
Sr EMP# EMP-NAME JOIN-DT
textbox1 textbox2 textbox3 textbox4
textbox5 textbox6 textbox7 textbox8
textbox9 textbox10 textbox11 textbox12
textbox13 textbox14 textbox15 textbox16
textbox17 textbox18 textbox19 textbox20

<NEXT BUTTON> <PREV BUTTON >

Please help me to find the solution for this .
 
Assumption: you've filtered your database to extract the 25 records that you
want to display. (You can use the autofilter method and visiblecells
property to get those records and read them into an array.)

When the "Next" button is clicked, simply read from that extract using
indices that are 5 higher than previously, or 5 lower for the "Previous"
button. Store the current index in a variable, and you're all set.

HTH,
Bernie
MS Excel MVP
 
Thanks Bernie Deitrick, But it would be appreciate , if you could send the
VBA code for this !

Regards
jOPHY

Bernie said:
Assumption: you've filtered your database to extract the 25 records that you
want to display. (You can use the autofilter method and visiblecells
property to get those records and read them into an array.)

When the "Next" button is clicked, simply read from that extract using
indices that are 5 higher than previously, or 5 lower for the "Previous"
button. Store the current index in a variable, and you're all set.

HTH,
Bernie
MS Excel MVP
In a worksheet around 500 records are there -Employee number,employee
name,
[quoted text clipped - 20 lines]
Please help me to find the solution for this .
 
Can anybody give VBA code for this ?
Jophy

jophy said:
Thanks Bernie Deitrick, But it would be appreciate , if you could send the
VBA code for this !

Regards
jOPHY
Assumption: you've filtered your database to extract the 25 records that you
want to display. (You can use the autofilter method and visiblecells
[quoted text clipped - 13 lines]
 
Back
Top