Scrolling text on splash screen

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a splash screen that has a field I want to put about 3 pages of text
into. The field should only show 3 or 4 lines of text and should scroll. The
text will never change, therefore it should not be editable. I have tried to
do this but can get it to work. How would you all do this?

thanks,
Damon
 
Use the Timer event of the form to replace the Caption of the Label.

The example below has 6 lines of text to scroll up in a label named
lblScroll that shows 4 lines at a time:

Option Compare Database
Option Explicit

'Array of the lines to be scrolled in Form_Timer.
Private astrScrollText(0 To 5) As String

Private Sub Form_Load()
'Purpose: Load the array to use in Form_Timer.
astrScrollText(0) = "first line"
astrScrollText(1) = "2nd line"
astrScrollText(2) = "3rd line"
astrScrollText(3) = "4th line"
astrScrollText(4) = "5th line"
astrScrollText(5) = "last line"
End Sub

Private Sub Form_Timer()
'Purpose: Assign the text to scroll.
Dim i As Integer 'Loop controller.
Dim strOut As String 'Output string.
Static iIndex As Integer 'Array element index.
'Number of lines high the caption is (zero-based)
Const icCaptionHeightLessOne = 3

'Create the output string from the items in the array.
For i = 0 To icCaptionHeightLessOne
strOut = strOut & astrScrollText((iIndex + i) _
Mod (UBound(astrScrollText) + 1)) & vbCrLf
Next

'Assign to the caption of the label.
Me.lblScroll.Caption = strOut

'Move the static array index to the next item.
iIndex = iIndex + 1
If iIndex > UBound(astrScrollText) Then
iIndex = LBound(astrScrollText)
End If
End Sub
 
LOL, this is what I get for being obtuse. What I meant by "should scroll" is
that the user should be able to use the mouse to scroll through the text just
like you would be able to if the page you are trying to view in a web browser
is too big for your resolution.

Just so you don't get me wrong, I super appreciate your solution! I just
wasn't looking for such a beautifully fancy effect. Now that I have it
though, I am going to try it out. I never even thought of something like this
and am glad you did. One question though, will this loop through the text or
stop when it gets to the end of the lines of text; I only scanned the code
and am not very strong in it regardless.

Once again, thanks so much for the help Allen,

Damon
 
I got the code to work for a 5 line message on the same splash screen. Looks
cool :-)

Unfortunately, to do the 3 page long document and retain its formatting
looks like a very large chore, if it is possible, which I am not sure. Right
now I have the document in a Microsoft Word OLE object. It has retained the
formatting but only shows as much as whatever size I make the object. All I
need is to add a scroll bar so that the user can scroll down, but that seems
to not be an option with the OLE object. Any suggestions?
 
Thanks for the tip, unfortunately I am unable to get this control to work. I
don't know how knowledgeable you are with it, but all I want to do is copy
paste the text in my word document into the control and when the form runs be
able to scroll down it. I tried copy pasting but the control will not retain
the data. I tried connecting the control to a table with a memo type field
that had my text as the only record but still no dice. Not sure what to do
now.

Thanks for you help,

Damon
 
Download the sample MDB and look at the form in Design view. You hook up the
data field for the RTF control exactly as you would for a TextBox control.
It must be bound to a Memo field.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
That's what I was looking to do. I can't find the Control Source attribute of
the RTF2 object so I'm not sure how to attach my memo field to it? What am I
missing?
 
How would you set the ControlSource for a native Access TextBox control?
It's the same procedure for the RTF2 control.

In Form Design view
Right click onthe RTF control
Select Properties
Select the DATA tab
Select the Control Source drop down arrow
From the DropDown List control select whatever field you have setup as the
Memo type field for the RTF2 control

Remember, just like any native Access control, the Recordsource for the Form
the RTF2 control is residing on myust contain the Field you want to bind to
the Control Source of the control.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
There's my problem. the RTF2 control does not have a control source option in
the Data tab; all there are, are the following three attributes:
OLE Class
Class
Enabled.

No Control Source. Any Ideas?
 
Sound like you did not install the control properly.

Control Panel->Add/Remove Software
Locate the RTF2 app and uninstall it.

Download the FULL install package on my site and run the Installation app.

Let me know how you make out.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
OK, I reinstalled it and now I have the control source attribute. :-) I have
set the form's Record Source attribute to the table with the document in it.
I then created both a RTF2 and text control so that i can compare the 2
functionally. I set both the control's control source to the field with the
document. the text box shows the document (but without formatting and no
scroll bar) and the RTF2 control shows nothing. the table i am dealing with
has two fields, a key field which is an automated number and a memo field for
my document. there is one record in the table: the key field has the value 1
and the article field has my document in it. Any ideas?
 
The RTF2 control expects to find RTF encoded text in the field it is bound
to. In other words it will not display plain text.
Try typing in a few words and use the right mouse context MEnut oa pply
formatting.

If you have plain text you want to load into the control just copy and paste
it or use code to set the RTF's control plain text property.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Open your form in single form view.
Click in the RTF control to make it active
Type a few words
Use your mouse to select all(or a portion) of the text you just typed in
Right click on the selected(highlighted) text
format as desired from the context Menu that appears

When you are finished, move to a different record to have your editing in
the RTF control saved.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
OK, I did all of that, however, aside from the problem that the highlighting
doesn't show so you can't tell if it is highlighted(something you may want to
look into), I don't see how this relates to me displaying a word document
that is already foramtted? I am not interested in changing its format, just
showing it in its entirety without having to create a control that is larger
than the display. If the RTF2 control will not display anything but the
actual text complete with formatting characters then how would I convert my
word document into a version that displays the formatting characters?
 
If you just want to display a work document use the Microsoft MODI ActiveX
control here:
I have used this control and in preliminary testing it works well on a plain
Access Form in single form view.
http://support.microsoft.com/default.aspx?scid=kb;en-us;311765
Visual C++ ActiveX Control for hosting Office documents in Visual Basic or
HTML.



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
It's a start, but still not what i am looking for. It provides no way to
remove the rulers or the space above the document where the menu, title, and
toolbars normally sit; there is just a white unoccupied area. Also I don't
wish the user to have the option to change the view of the document, which is
offered by the view buttons in the bottom left corner of the control. I do
appreciate your help Stephen, thanks for sticking with it. :-)

Damon
 
I believe a portion of the user interface can be controlled. Check the
properties for the control.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
You are correct and I have done so. Unfortunately, when you turn of the afore
mentioned toolbars there is an empty white space left behind where they would
go. Also, there does not appear to be an option for controlling the
appearance of the ruler or the view icons in the bottom left corner.
 
Back
Top