?
Solved

Marquee style or ticker tape scrolling of information across MS Access form

Posted on 2008-10-16
5
Medium Priority
?
1,913 Views
Last Modified: 2013-11-28
Hi experts,

I am trying to a Marquee style or ticker tape scrolling of information across MS Access form.  A little while ago I found the following code on the net but have mislaid the name of its source.  I have used the code in my application but am getting a very juddery result.  I am trying to achieve a smooth marquee style of scrolling.

The code I am using is as follows:

Option Compare Database
Public vCount As Integer
Public vMessage As String
Public vLen As Integer
Public vTicker As String
Private Sub Form_Load()
' -------- the following code is needed for the right to left scrolling text box ---------
    Me.txtScroll.Enabled = False
    Me.txtScroll.Locked = True
    Me.txtScroll.TextAlign = 3 ' 3 - enters from right to left
    vCount = 1
 
    ' modify these settings to your liking
    Me.TimerInterval = 10  '1000 = 1 second delay for each character
    vMessage = "Ticker tape example. Need to find better solution so that the message does not judder." ' do not have more than 250 characters
    vMessage = vMessage + "     " ' add 5 spaces for effect
    ' end user modify settings
    vLen = Len(vMessage)
'----------- end scrolling text -------------

End Sub

Private Sub Form_Timer()
'-------- code for scrolling text box -------------
    If vCount <= (vLen) Then ' repeat when the counter is same as the message length
        vTicker = vMessage + Mid(vMessage, 1, vCount) ' change the display message by 1 character
        Me.txtScroll = vTicker 'display the message
        vCount = vCount + 1
    Else
        vCount = 1 ' reset counter
    End If
' ------------ end code scrolling text box -------------
End Sub


I would be grateful if anyone could suggest either an alternative approach that produces a smoother result or alternatively could help me with additional code to improve the above scrolled message.

Many thanks,
Terry
0
Comment
Question by:TerenceHewett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 85
ID: 22730476
You might try adding some DoEvents to the code in your Timer ... or a Me.Repaint in your timer loop. That said, this sort of thing is very dependent on many factors, including machine power, video adapter, refresh/resolution rates, monitor specs, machine "load" etc etc etc ...
0
 

Author Comment

by:TerenceHewett
ID: 22731711
Hi LSM,

Thanks for your help and comments.  If I wanted to add either the me.Repaint into the timer loop or add some DoEvents code, how would I go about doing this? DoEvent coding is not something I have had experience of.

Any further help would be gratefully received.

Regards,
Terry
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22737590
TerenceHewett,

I have never seen "Smooth" scrolling text in an Access form.
(For all the reasons LSM mentioned above)

Even the dedicated "Marque" control available in Data Access Pages is "Jittery"

You can ante up and buy a dedicated control, if this is that important to you:
http://www.fmsinc.com/Products/components/ControlTour/marquee.htm

JeffCoachman
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 22739086
DoEvents is a function that basically allows the machine to 'catch up' during intensive code operations. You use it liket his:

Private Sub Form_Timer()
'-------- code for scrolling text box -------------
    If vCount <= (vLen) Then ' repeat when the counter is same as the message length
        vTicker = vMessage + Mid(vMessage, 1, vCount) ' change the display message by 1 character
        Me.txtScroll = vTicker 'display the message
        vCount = vCount + 1
    Else
        vCount = 1 ' reset counter
    End If
    DoEvents <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
' ------------ end code scrolling text box -------------
End Sub

Same with Me.Redraw

And the Timer function on a Form seems (at least to me) to be very low priority in the hierarchy of Events, which may mean you're beating a dead horse on this one.
0
 

Author Comment

by:TerenceHewett
ID: 22889628
Thank you for all comments made and for the help in getting me to understand the DoEvent functon.

Best regards, Terry
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question