Open a form and automatically scroll through the records

H

Hammer

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?
 
D

Damian S

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.
 
H

Hammer

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top