Open a form and automatically scroll through the records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I’d like to figure out how to open a form (that is in Continuous Forms View)
and scroll through the records using code. I’m hoping the visual effect will
be a slow vertical scrolling of the records. Once I get to the bottom of the
records I want the form to close.

Any suggestions of how I would go about doing this? Is there a way to
control the scroll speed? Can I delay before I start to scroll?
 
Hi Hammer,

I haven't done this before, but the way you *could* go about it is to use
the On Timer event of the form, and move to the next record each time the
timer expires.

Check for the last record, and then exit. eg:

if not LASTRECORD then
docmd.GoToRecord acDataForm, me.name, acNext

else
docmd.close
end if

If you can't work out whether you are on the last record, a quick and dirty
solution is as follows:

On Error GoTo LASTRECORD
DoCmd.GoToRecord acDataForm, Me.Name, acNext

Exit Sub

LASTRECORD:
DoCmd.Close

Hope this helps.

Damian.
 
Thanks. I'll give that a try. I think that will get me a little closer to my
final goal.
 
Back
Top