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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling Text 2

Status
Not open for further replies.

ind

Programmer
Mar 9, 2000
121
US
Does anyone have any code to make text scroll horizontally through a textbox??<br>
 
What is your result here?<br>Scroll Automatically?<br><br>Need more Input... <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Yes.<br>I want the text to scroll automatically, continuously to catch the user eye.
 
basically you want to create a marquis effect.&nbsp;&nbsp;the only way that i can think of doing this without trying to locate a predesigned utility to do such would be to have code behind it that had a timer involved that actively changed the visible text in the following manner:<br><b><br>Visible text in textbox.<br>isible text in textbox.<br>sible text in textbox.&nbsp;&nbsp;V<br>ible text in textbox.&nbsp;&nbsp;Vi<br></b><br>etc...<br><br>you would probably have to type out every possible variable here, and then have a loop with a timer that just changed it at a set interval that made it appear to move.<br><br>i'm not that good with loops, so i'm not sure if this would work or not.&nbsp;&nbsp;i'm curious to know if it does though. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
just a quick thought on how to loop it <br>real rough code below <br><br>dim leftvar as integer, rightvar as integer<br>loop<br>leftvar=leftvar-1 ,rightvar = rightvar=1<br>left([text],leftvar) right([text],rightvar)<br>if variables = len([text]) reset variables<br>end if<br>return loop<br>better then typing every possible variable<br>
 
I've got errors poping up everywhere with this code. Can someone please help?????
 
The posting I made is not intended to be working code only a thought on how to loop it. Sorry if you misunderstood.
 
Working&nbsp;&nbsp;code for scrolling text<br>create an unbpund text box then place this code under the froms on timer event. be sure to replace where it says your stuff with your fields<br><br>Private Sub Form_Timer()<br>Dim textlen As Integer<br>Static astr As Integer<br>Dim textstr As String, a As Integer<br>textlen = Len(Me.[Your field name])<br>astr = astr + 1<br>If astr &gt;= textlen Then astr = 1<br>textstr = Mid([Your field name], astr, Len([Your field name])) & &quot; &quot; & Left([Your field name], astr)<br>Me.Your unboundtextbox.Value = textstr<br><br>End Sub<br><br>need to place 1000 on forms timer interval<br>
 
I would like to do this on my switchboard. Is this possible? I read the FAQ on this and I'm having brain freeze! Help!
 
glo4, I just implemented your code on one of my main forms and it works Super!!! Thanks alot for posting that very helpful tip.
As for lunchboxkid, if you are referring to Access's default switchboard you can still use this code as well, just like you would on any other form. Be sure to stick this code in the forms on timer() event and set the timer interval() as well.
 
Hi glo4!!!
i have not got this code correct.
assume that i want a label on a form label30 &quot;Company Balance Sheet&quot; form name opening page scrolling i understand most of the timer code and the duration.but what do i insert in field name and text7 at the bottom. i am missing something
regards
john
Bournemouth England
genesis2000ad@yahoo.co.uk
 
collegejohn just happened to stumble on to this


Just paste this code
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Private Sub Form_Timer()
Dim textlen As Integer, textstr As String
Dim strfield As Variant
Static astr As Integer
strfield = &quot;Company Balance Sheet&quot; &&quot;&quot; 'static data so Jut typed it in
textlen = Len(strfield)
astr = astr + 1
If astr >= textlen Then astr = 1
textstr = Mid([strfield], astr, Len([strfield])) & &quot; &quot; & Left([strfield], astr)
Me.label30.caption = textstr 'replaced with labelname.caption

end sub

'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

set timer interval to around 500

It's all in the FAQ hope this clears it up for you
 
Thanks a bunch!!! gol4 regards
john
Bournemouth England
genesis2000ad@yahoo.co.uk
 
Thanks for this one - it finishes my application off nicely!

Cheers - Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top