Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: Access Other topics FAQ

A scrolling text box

How do I make text scroll like a marquee by gol4
Posted: 21 Jun 00 (Edited 14 Jun 04)

Step1 create an unbound textbox or a label
Step2 Paste this code in the forms code section

'start paste
Private Static Function Scrolltext(Strfield As String) As String
æcall from on timer event
Dim astr As Integer
Dim TextLen As Integer
   astr = astr + 1
   TextLen = Len(Strfield)
   If astr >= TextLen Then astr = 1
    Scrolltext = Mid([Strfield], astr, Len([Strfield])) & " " & Left([Strfield], astr)
   End Function

end paste
Step 3  Call the function from the forms on timer event
For any text
Me!text1.text =  Scrolltext("Hello World") 'Refer to the unbound text box

For a label
Me.label1.caption = Scrolltext("Hello World")

To use data from a field

Me.text1.text= Scrolltext(me.fieldname) or me.label1.caption = scrolltext(me.fieldname)

Step 4 set the forms timer interval. The higher the number the slower it scrolls around 100 is usually good enough

Step 5 Open the form then sit back and watch your text scroll by.

Spell Out
'spells out word call from timer event
Private Static Function SpellOut(strMessage As String) As String

Dim iCount As Integer
Dim iLen As Integer
   iLen = Len(strMessage)
   If iCount >= iLen Then iCount = 1
   SpellOut = Left(strMessage, iCount)
   iCount = iCount + 1
    End Function

Back to Microsoft: Access Other topics FAQ Index
Back to Microsoft: Access Other topics Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close