Hello all,
The below code works fine when the main form (switchboard replacement) starts up. I want to retain the below option by a user to choose the scrolling text message using InputBox, which isn't included in the searches on this fora. The only improvement would be to trigger the timer at will, rather than only being able to create a message when the main form starts up. So, how do you control triggering the form timer? Timer interval is 250. Thanks.
John
----Code
Private Sub Form_Timer()
Static strMsg As String, intLet As Integer, intLen As Integer
Dim strTmp As String
Dim strChng As Variant
Const TXTLEN = 90
If Len(strMsg) = 0 Then
strChng = InputBox("Create scrolling message.", "Create scrolling message")
strMsg = Space(TXTLEN) & strChng ' & vbCrLf _
' & "www. .com/ " & Space(TXTLEN)
intLen = Len(strMsg)
End If
intLet = intLet + 1
If intLet > intLen Then intLet = 1
strTmp = Mid(strMsg, intLet, TXTLEN)
lblScroll.Caption = strTmp
End Sub
The below code works fine when the main form (switchboard replacement) starts up. I want to retain the below option by a user to choose the scrolling text message using InputBox, which isn't included in the searches on this fora. The only improvement would be to trigger the timer at will, rather than only being able to create a message when the main form starts up. So, how do you control triggering the form timer? Timer interval is 250. Thanks.
John
----Code
Private Sub Form_Timer()
Static strMsg As String, intLet As Integer, intLen As Integer
Dim strTmp As String
Dim strChng As Variant
Const TXTLEN = 90
If Len(strMsg) = 0 Then
strChng = InputBox("Create scrolling message.", "Create scrolling message")
strMsg = Space(TXTLEN) & strChng ' & vbCrLf _
' & "www. .com/ " & Space(TXTLEN)
intLen = Len(strMsg)
End If
intLet = intLet + 1
If intLet > intLen Then intLet = 1
strTmp = Mid(strMsg, intLet, TXTLEN)
lblScroll.Caption = strTmp
End Sub