NickB
NickB

Reputation: 113

Scrolling to the bottom of a Subreport in a Form (Access 2016)

I have a subreport within a Form, and often this report has more rows than the height of the subreport. I would like to either:

  1. Grow the subreport (on screen) to show all rows (which I don't think is possible on-screen)
  2. Scroll to the end of the subreport, so that final row(s) plus footer (with sums) are shown for each record

I have tried, unsuccessfully, to do a SetFocus on the subform containing the report in the Form's Current event, and then in the subreport's GotFocus event add a SetFocus on one of the sum fields in the footer. If I click on the report, the GotFocus event fires and it scrolls to the bottom, but it isn't working automagically.

Any suggestions to achieve either of these outcomes would be greatly appreciated!

Upvotes: 1

Views: 1170

Answers (1)

ComputerVersteher
ComputerVersteher

Reputation: 2696

  1. Grow subreport has limit on Screen size, but you can resize to fit screen
  2. To move to last record you have to set focus to a control on report (First focus subreport control, then control on subreport)
Me.subreportcontrol.SetFocus
Me.subreportcontrol.Report.AnyControl.SetFocus

DoCmd.GoToRecord acActiveDataObject, , acLast

WhereAnyControlis any control on subreport.

Upvotes: 1

Related Questions