Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get Microsoft Access scrolling marquee to work on a form? 3

Status
Not open for further replies.

Kativs

Technical User
Sep 19, 2008
74
US
I created a text box to make a scrolling marquee in my form and included a string that I found on the internet to get this to work. However, the words in the text box still just sit. How can I get this to marquee please?
Please explain in detail as I am an Access for Dummy.
Thanks very much.
 
and included a string that I found on the internet to get this to work.
Could you show this to us please? Might help to tell you why it doesn't work.

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Sorry, I have since deleted the text box in thoughts of starting from scratch. Any advice?
Thanks much.
 
Here's an example going from the very simple and then a little bit morte complex.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks. I'll give it a try and let you know.
 
Okay,,,here is where I get confused. Sorry to appear an access moron but in your attached example #2 and #3 I'm lost:
I don't see anything that says TimerInterval or OnTimer event. And if I did, the statement of taking off the first character of the string and appending it to the end loses me as well.
 
No worries [smile]

The TimerInterval is in the form's Properties window under the All tab. The On_Timer event is just above that. Set the interval to say, 200 and then change the value in On Timer to "Event Procedure". Once you've done that, click on the three dots next to it and that will take you into the code for the form's On_Timer event (which will happen however often that you set the interval earlier).

The code assumes that you have a label named lblMarquee that has some text set as the Caption property.
Code:
lblMarquee.Caption=Mid(lblMarquee.Caption, 2) & Left(lblMarquee.Caption, 1)
What this basically does is everytime the timer happen (fires) it takes the left most character of the current caption and moves it to the end.

It does this by selecting the leftmost character using:
Code:
Left(lblMarquee.Caption, 1)
Which means everything from the left for 1 character.
It then appends this to the rest of the string excluding the original leftmost character using:
Code:
Mid(lblMarquee.Caption, 2)
This means, get everything until the last character starting at the character in position 2.

Hope that helps give you a better insight into this.

Regards


HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
(sigh) You have been great help to me. I think I need a vacation.
I don't see the TimerInterval or the On_Timer event in the form's Properties window under the All tab. Keep in mind when I look at properties I see the "text box" properties. I don't see the "FORM"'s properties.
I understand the rest.
 
Okay with patience I found the "form" properties and below is the code I entered but I now get an error.

Private Sub Form_Timer()
lblMarquee.Caption = Mid(lblMarquee.Caption, 2) & Left(lblMarquee.Caption, 1)
End Sub

"The error I get is "method or data member not found."
The work "caption" (first one) is highlighted in blue. At first I misspelled it. This time you see what I have.
What now?
Thanks again!
 
As an aside, are you very sure that you want a moving part on your form? It can be difficult to work with, for example many people block ads that move on websites.

 
Leslie,

Yeah, that was the line of questioning I was going to go down.

My other thought was that lblMarquee might be a textbox...

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Yes I have the label as lblMarquee. But yes it's a text box. Should it be a "label" ?
Thanks again.
 
Yeah, it should be a label (as it is for displaying text rather than accepting input like a textbox), but if you wanted to use a textbox instead you would use the .Text property instead of .Caption.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
In addition to Remou's point, scrolling controls can be difficult to work with, if you have a scrolling marquee but need to go off and do somekind of heavy processing in the background (admittedly, I'd assume it's unlikely in this particular case but in general), as the marquee will be on the same thread as the UI it will stop, not ideal.

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
HarleyQuinn said:
you would use the .Text property instead of .Caption
Actually, you would use the .Value property or no property since the Value property is the default for text boxes.

The Text property is rarely used in Access since the text box must have the focus in order to change its Text property.

Duane
Hook'D on Access
MS Access MVP
 
Duane,

Of course, sorry about that. [blush]

The pains of working in VB at work and trying to answer Access questions at the same time!

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
HOORAY! Thanks all. I deleted the text box, put in a label, the timer interval code etc was already there.
Works like a charm.
Thanks so much. Hope this thread helps someone else out too.
 
By the way, yes I really wanted a marquee so my users see any note I wish them to see such as *DO NOT DELETE* or *SAVE WORK FREQUENTLY* etc etc. Especially good with new users if they have access to add to the forms they can really mess things up.
Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top