Creating a scrolling marquee

rikklaney1

Registered User.
Local time
Today, 02:15
Joined
Nov 20, 2014
Messages
157
Hi guys, I've been playing around with trying to make a scrolling marquee on an access form and it works. Kinda neat, or not. Anyway I can't figure out how I could get it to change. Here's what I've got....


Private Sub Form_Open(Cancel As Integer)
message = "my message"
End Sub
Private Sub Form_Timer()
Text0 = message
'Get first character
Dim FChar As String
FChar = Left(message, 1)
'Remove first character
message = Mid$(message, 2, Len(message) - 1)
'Put 1st character at the end of the message.
message = message + FChar
End Sub


and that works great. Now I'm trying to make it get the message value from a table so I change to this...

Private Sub Form_Open(Cancel As Integer)
message = Text0.Value
End Sub
Private Sub Form_Timer()
Text0 = message
'Get first character
Dim FChar As String
FChar = Left(message, 1)
'Remove first character
message = Mid$(message, 2, Len(message) - 1)
'Put 1st character at the end of the message.
message = message + FChar
End Sub

and set the control source for text0 to a field in a table. the problem is when I change the message in the table or add another record the marquee doesn't change unless I completely close and re-open the form. Is there a way to make it update without closing and restarting?
 
I had looked at that post once before, although re-reading it I did find some improvements I could make. But I still can't find a way to get it to "change on the fly" as it were. I did find how to make it go through every record in the table and display them one after another so that's very cool (thanks to ghudson who gave thanks to Ricky hicks at utter access)... but I still have to close and re-open for new records to be added to the scroll.
 
I've got this code for the open of the form...


Private Sub Form_Open(Cancel As Integer)
Dim rsNewsItems As Dao.Recordset 'Reference to DAO must be selected from Tools->References
Dim strNews As String
Set rsNewsItems = CurrentDb.OpenRecordset("marquee", dbOpenSnapshot, dbReadOnly)
rsNewsItems.MoveFirst
Do Until rsNewsItems.EOF
strNews = strNews + rsNewsItems("marquee") + " ... "
rsNewsItems.MoveNext
Loop
Set rsNewsItems = Nothing
message = strNews
End Sub


and if I'm understanding right this tells it what will be in the scroll... but it only does this on form open and if I put it in on timer nothing works. So I need to put this somewhere else to trigger it to recheck this...correct?
 

Users who are viewing this thread

Back
Top Bottom