Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to limit the number of records in a subform 1

Status
Not open for further replies.

sallieann

Programmer
Sep 2, 2003
28
GB
Hi there, any help will be greatly appreciated!

I have built an Access form which has a subform (in Continuous Forms view) to display a list of records. I don't want there to be a horizontal scrollbar and would like to limit the number of records to 20 per page. The user can then click on a "Next" button and see records 20-40, and then click back to first 20 records if they need to do so. I'm thinking I would need to code some Visual to say if >20 then... or perhaps some SQL... Could anybody point me in the right direction or show me an example where this has been done as I can't find anything!

Many thanks in advance.
 
SallieAnn,

Add two buttons to your subform: 'Next 20' and 'Previous 20'

in the Next 20 on_click event type:
DoCmd.GoToRecord , , acNext, 20

in the Previous 20 on_click event type
DoCmd.GoToRecord , , acPrevious, 20


HTH
Rich


Bespoke and off-the-shelf Access solutions
 
Rich

Many thanks for your reply - it works perfectly, and it is such a straightforward solution. Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top