I need my records to scroll contuosly *8282008!

J

J.Alladien

Hello to All,

I need a function or code to move from one record in my form to another
continously like a constant loop till I stop it ofcourse( if it reaches the
last record I want it to start allover with the first record etc...) , would
be great if it could also be paused but that's not necessary!

Thanks in advance!
 
K

Klatuu

Yes. For testing purposes, I set the Timer Interval for the form to 3000 (3
seconds), set it to whatever you need.
In the Timer Event:

Private Sub Form_Timer()
With Me
If .Parent.opgScroller = 1 Then
With .Recordset
If .AbsolutePosition = .RecordCount - 1 Then
.MoveFirst
Else
.MoveNext
End If
End With
End If
End With
End Sub

Notice the reference to Me.Parent.opgScroller
It is an option group I put on the main form with two option buttons labeled
start and stop. The start button option value is 1 and the stop button
option value is 2. The default for the option group is 1.

To stop the scroll click the stop button. The option group will now return
2 and will not move the record pointer. Once you click on the start button,
scrolling will resume.
 
T

Tony Toews [MVP]

J.Alladien said:
I need a function or code to move from one record in my form to another
continously like a constant loop till I stop it ofcourse( if it reaches the
last record I want it to start allover with the first record etc...) , would
be great if it could also be paused but that's not necessary!

Why? I personally would refuse to use such an app as I find moving
objects on the screen to be very distracting. I despise such web
sites.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
J

J.Alladien

Dave,

As I do almost never use option groups ,I probably made a mistake ;

I did everything like you said and created a option group with 2 labels
"START" and "STOP" respect. having value 1 and 2 , the option group itself I
named "Parent.opgScroller"

When I open the form I get this message" run-time error 2452;the expression
you entered has an invalid referance to the parent property"

and the following line gets highlighted:
"If .Parent.opgScroller = 1 Then"

What am I doing wrong?
 
J

J.Alladien

No I am going to link this DB to a TV and use it to dispay product info and
pics!
 
C

Clif McIrvin

I'll jump in here --- the .parent is a reference to the main form,
assuming that your scrolling recordset is in a subform. The control
would be named "opgScroller".
 
Top