Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

adding scrolling text in access

Posted on 2007-04-02
11
Medium Priority
?
2,068 Views
Last Modified: 2009-02-18
Where is the activex/ole scrolling text. Spent too much time just looking for it in the tools box addins in access. It may be it is not included? If not how do I get it with access 2003

I just twant to simply add a text box in access with scrolling text.
Does it have a different name than simply "scrolling text"?

http://office.microsoft.com/en-us/access/HP052801351033.aspx

0
Comment
Question by:vstav
[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
  • 7
  • 3
11 Comments
 
LVL 13

Accepted Solution

by:
adraughn earned 300 total points
ID: 18837793
just use this code on your form's OnTimer event. set your Timer Interval to 120.

adria

Sub Form_Timer()
Me.lblMyMessage.Caption = Scrolltext("Your Text")
         
         ' IDLEMINUTES determines how much idle time to wait for before
         ' running the IdleTimeDetected subroutine.
         Const IDLEMINUTES = 6
         Static PrevControlName As String
         Static PrevFormName As String
         Static ExpiredTime

         Dim ActiveFormName As String

         Dim ActiveControlName As String
         Dim ExpiredMinutes

         On Error Resume Next

         ' Get the active form and control name.
         ActiveFormName = Screen.ActiveForm.Name
         If Err Then
            ActiveFormName = "No Active Form"
            Err = 0
         End If

         ActiveControlName = Screen.ActiveControl.Name
            If Err Then
            ActiveControlName = "No Active Control"
            Err = 0
         End If

         ' Record the current active names and reset ExpiredTime if:
         '    1. They have not been recorded yet (code is running
         '       for the first time).
         '    2. The previous names are different than the current ones
         '       (the user has done something different during the timer
         '        interval).
         If (PrevControlName = "") Or (PrevFormName = "") _
           Or (ActiveFormName <> PrevFormName) _
           Or (ActiveControlName <> PrevControlName) Then

            PrevControlName = ActiveControlName
            PrevFormName = ActiveFormName
            ExpiredTime = 0
         Else
            ' ...otherwise the user was idle during the time interval, so
            ' increment the total expired time.
            ExpiredTime = ExpiredTime + Me.TimerInterval
         End If


         ' Does the total expired time exceed the IDLEMINUTES?
         ExpiredMinutes = (ExpiredTime / 1000) / 60
         If ExpiredMinutes >= IDLEMINUTES Then


            ' ...if so, then reset the expired time to zero...
            ExpiredTime = 0
            ' ...and call the IdleTimeDetected subroutine.
            IdleTimeDetected ExpiredMinutes
         End If
End Sub


Sub IdleTimeDetected(ExpiredMinutes)
    Application.Quit acSaveYes
End Sub
0
 
LVL 13

Expert Comment

by:adraughn
ID: 18837816
note: not tested in 2k3.
0
 
LVL 13

Expert Comment

by:adraughn
ID: 18837824
and here is the function:

Public 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
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:vstav
ID: 18837858
isnt there a control i can add from the toolbox in access? instead of doing it via code above
0
 
LVL 13

Expert Comment

by:adraughn
ID: 18837916
0
 

Author Comment

by:vstav
ID: 18837946
exactly adraughn: but i cant find that control in my toolbox so i can add it.where the h@ck is it????
0
 
LVL 13

Expert Comment

by:adraughn
ID: 18838025
is this a db that you created in access 2003? if not, you would have to convert it to have access to the tool, since it was not available in 2k.
0
 
LVL 34

Assisted Solution

by:jefftwilley
jefftwilley earned 200 total points
ID: 18838028
'----------------------------For the Scrolling Text-------------------------
    Static strMsg As String, intLet As Integer, intLen  As Integer
    Dim strTmp As String
    Const TXTLEN = 100
    Me.TimerInterval = 10000
    If Len(strMsg) = 0 Then
        strMsg = Space(TXTLEN) & "Select an option and press Start!" ' & Space(TXTLEN) '& "More text to scroll" & Space(TXTLEN)
        intLen = Len(strMsg)
    End If
    intLet = intLet + 1
    If intLet > intLen Then intLet = 1
    strTmp = Mid(strMsg, intLet, TXTLEN)
    Me.lblScroll.Value = strTmp    '<----your label


will be added to an on_timer event for a form.
0
 
LVL 13

Expert Comment

by:adraughn
ID: 18838059
by the way, that control can only be used in a data access page. so if you want to use scrolling text on anything else, you will have to use the code provided.

adria
0
 

Author Comment

by:vstav
ID: 18838213
well thats the problem. I want it in a simple access database client, not dap.
therefore it can only be done  through code above??
0
 
LVL 13

Expert Comment

by:adraughn
ID: 18838247
my code or jeff's. let us know if you have any issues.

adria
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

610 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