Scroll Message

B

Bob Quintal

I’m using the following code to scroll a message across the
bottom of a form:

Private Sub Form_Timer()

Static strMsg As String
Static intLet As Integer
Static intLen As Integer
Dim strTmp As String
Const strLen = 250

If Len(strMsg) = 0 Then
strMsg = Space(strLen) & "my message" & Space(strLen)
intLen = Len(strMsg)
End If

intLet = intLet + 1

If intLet > intLen Then
intLet = 1
End If

strTmp = Mid(strMsg, intLet, strLen)

Me!lblScroll.Caption = strTmp

If strTmp = Space(strLen) Then
intLet = 1
End If

End Sub

I must enter the message into the “my message†space with
quotes. What I need is to be able to enter the message with having
to open Microsoft Visual Basic every time. It would be great if I
could enter the message in a form and the form would change the
message.

Thanks
S
Create a new table, with one field in it, My_Message, length 250.
Then modify the code to open a recordset that contains the field,
and use it instead of your literal data.
 
P

pushrodengine via AccessMonster.com

I’m using the following code to scroll a message across the bottom of a form:

Private Sub Form_Timer()

Static strMsg As String
Static intLet As Integer
Static intLen As Integer
Dim strTmp As String
Const strLen = 250

If Len(strMsg) = 0 Then
strMsg = Space(strLen) & "my message" & Space(strLen)
intLen = Len(strMsg)
End If

intLet = intLet + 1

If intLet > intLen Then
intLet = 1
End If

strTmp = Mid(strMsg, intLet, strLen)

Me!lblScroll.Caption = strTmp

If strTmp = Space(strLen) Then
intLet = 1
End If

End Sub

I must enter the message into the “my message†space with quotes. What I need
is to be able to enter the message with having to open Microsoft Visual Basic
every time. It would be great if I could enter the message in a form and the
form would change the message.

Thanks
S
 
P

pushrodengine via AccessMonster.com

I created a table called tblMessScroll and within the table is a single field
called My_Message.

How do it modify the code?
 
D

Douglas J. Steele

Private Sub Form_Timer()

Static strMsg As String
Static intLet As Integer
Static intLen As Integer
Dim strTmp As String
Const strLen = 250

If Len(strMsg) = 0 Then
strMsg = Space(strLen) & _
DLookup("[My_Message]", "[tblMessScroll]") & _
Space(strLen)
intLen = Len(strMsg)
End If

intLet = intLet + 1

If intLet > intLen Then
intLet = 1
End If

strTmp = Mid(strMsg, intLet, strLen)

Me!lblScroll.Caption = strTmp

If strTmp = Space(strLen) Then
intLet = 1
End If

End Sub

Just be aware, though, that some individuals vehemently dislike scrolling
text. I know I'd likely refuse to use the application if I was subjected to
scrolling text!
 
B

Bob Quintal

Private Sub Form_Timer()


End Sub

Just be aware, though, that some individuals vehemently dislike
scrolling text. I know I'd likely refuse to use the application if
I was subjected to scrolling text!
I'm one of those, and even worse is FLASHING text. I've been known to
strangle programmers who flash text.
 
D

Douglas J. Steele

Bob Quintal said:
I'm one of those, and even worse is FLASHING text. I've been known to
strangle programmers who flash text.


A pet peeve of mine is programmers who insist on ignoring personally chosen
settings. I was once forced to work with an application that would not
accept dates in yyyy-mm-dd format, but forced me to use dd/mm/yyyy. It was
an extremely poorly written app (Lotus Notes: what do you expect?) There
were actually parts of the application that wouldn't accept dd/mm/yyyy
(possibly because my regional settings were yyyy-mm-dd)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top