running text on status

S

Souris

I want to have running text on the status bar.
Any example to do this?


Your information is great appreciated,
 
M

Marshall Barton

Souris said:
I want to have running text on the status bar.
Any example to do this?


If "running text" means a banner type if thing, then a form
can manage it with code like:

Private Sub Command0_Click()
If Me.TimerInterval > 0 Then
Me.TimerInterval = 0
Else
Me.TimerInterval = 200
End If
End Sub

Private Sub Form_Timer()
Static pos As Integer
pos = pos + 1
If pos > Len(Me.Text1) Then pos = 1
SysCmd acSysCmdSetStatus, Mid(Me.Text1 & " " _
& Me.Text1, pos, Len(Me.Text1))
End Sub
 
S

Souris

Thanks millions,


Marshall Barton said:
If "running text" means a banner type if thing, then a form
can manage it with code like:

Private Sub Command0_Click()
If Me.TimerInterval > 0 Then
Me.TimerInterval = 0
Else
Me.TimerInterval = 200
End If
End Sub

Private Sub Form_Timer()
Static pos As Integer
pos = pos + 1
If pos > Len(Me.Text1) Then pos = 1
SysCmd acSysCmdSetStatus, Mid(Me.Text1 & " " _
& Me.Text1, pos, Len(Me.Text1))
End Sub
 
S

Souris

Thanks for the message,

It works.
It is too fast to read.
I tried to change Timerinterval bigger or smaller which does not affect the
speed.
Are there any way to slow it down like sleep statement?

Thanks again,
 
D

Douglas J. Steele

To what did you change the TimerInterval? TimerInterval represents
milliseconds. Using 200 means that the Timer event would fire every two
tenths of a second. Try setting it to 1000 (1 second) and see whether that
has an effect, then tweak it up or down if you want a different rate.
 
S

Souris

Thanks for the message,

I tried from 100 to 2000. They are same speed.

It seems that the intervaltimer does not affect the speed of running, but it
afffects the even fired.

The speed of running is affected by the length of string.

Please let me know if I am wrong.
 
D

Douglas J. Steele

The length of the string should have no bearing on the speed of running.

The code in Form_Timer fires every time the TimerInterval has been reached.
Each time it fires, it increments the value of pos so that it goes from 1 to
2 to 3 and so on until it's equal to the length of the string contained in
Text1. At that point, it goes back to 1 and starts all over again. What's
shown in the status bar will be a modification of what's in the text box.
Let's say Text1 contains abc

The first time the Timer event fires, the status bar will be set to "abc"
The next time it fires, the status bar will be set to "bc "
The next time it fires, the status bar will be set to "c a"
The next time it fires, the status bar will be set to " ab"
It'll continue cycling through "abc", "bc ", "c a" and " ab" every time the
Timer event fires.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Souris said:
Thanks for the message,

I tried from 100 to 2000. They are same speed.

It seems that the intervaltimer does not affect the speed of running, but
it
afffects the even fired.

The speed of running is affected by the length of string.

Please let me know if I am wrong.
 
S

Souris

Thanks for the explaination.

I did several tests and found the following.

I have 2 forms which are main form and data entry form.
My running text function on the data entry form only.

The speed is too fast to read if I call data entry form from main form.
The speed is OK when I direct run data entry form.

My timerinteval value is set in data entry form and on timer even is in data
entry form only, but I see running text when I run the main form even without
data entry form.

Anthing I did wrong or any where I have look into?


Your help is great appreciated,
 
D

Douglas J. Steele

I can see that you might have the text on the status bar but not moving once
you close the data entry form (to cure that, put SysCmd acSysCmdClearStatus
in the form's Close event) I cannot think of any reason why you'd be seeing
scrolling text if the form isn't open. You sure you haven't accidentally
included code in the main form to provide running text?
 
S

Souris

Thanks again,

I found the problem.
In my main form to verify data entry form property which cause data ntry
form on load fired and ontimer as well.

Thanks again for helping,
 

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