Creating a scolling "Credits" from

  • Thread starter Thread starter Jeff Conrad
  • Start date Start date
J

Jeff Conrad

Hi,

Using Access 97 at the moment.

I'm trying to create a form that will display a list of all the people who have helped me in my
Access journey. I will put this on my About form and it will be like a list of credits for all the
people who have helped me (which would of course be everyone here). I got the idea from the About
form on a program called PcAnywhere which I use frequently. The version I have (9) has three tabs on
their About form: General, Credits, and System Info. When you click the Credits tab a list of all
the developers slowly scrolls up from the bottom to the top. Cool!

So I went searching everywhere for a similar type of sample. I came across some samples from Roger
Carlson, Graham Seach, and Sensei Lebans, but they were all horizontal scrolling text samples. I
want my text to scroll from bottom to top. Unbelievably I found in my personal vast Access
collection a file that does vertical scrolling. I downloaded the file over a year ago! It is by
Pedro Gil and Sensei Lebans.

After lots of searching I found the download spot.
You can find it here:

http://www.geocities.com/pmpg98_pt/VerticalMarquee.html

I've been playing with it for quite sometime, but have a couple of issues I cannot seem to resolve.
I'm hoping someone can help me solve the problems.

I've already made the table adjustments to my needs.
I have the font size at 8.
Here are the issues I am having:

1. I created a tab control on the form and moved the text box to the bottom of the Credits tab.
Right now I have the tab control (called tabAbout) sitting a little bit below the top of the Detail
section. I'd rather not have it all the way to the top of the Detail section. When the credits start
to roll everything is OK, but when they reach the top of the tab control they actually push the
whole tab control to the top of the Detail section!! Serious! I'd rather not have that happen! If I
go back into Design View the tabcontrol is still at .1146 (Top), but you'd swear the tab moves up
when you're viewing the credits!

2. A WaitTime in table design of 0 is too fast I think. The names go flying by. A WaitTime of 1
seems a bit too slow. So I changed the field to single and have .50 of a WaitTime. That seems to be
about right on speed. However, any WaitTime other than 0 (that includes just 1) makes the top of the
tab control virtually disappear! The two tab page captions virtually disappear as the names go
scrolling up! Not good! Is this a Painting issue?

3. I would like the names to continue scrolling up to the top until they are completely out of view.
Right now once the last name comes up the whole list just stops as it is designed to do. This seemed
easy to fix (so I thought). I added a bunch of dummy records with no text so the list would keep
scrolling but you wouldn't see anything. However, this raises the Error 94 "Invalid Use of Null"
because the code apparently has to have *something* in the text field. Darn! How can I get the names
to keep scrolling until they are out of sight?

So is there any chance of resolving the issues I'm having?
Any and all help is most appreciated.
 
Well after MANY hours of playing with this I've finally
achieved all of my desired results.

First off, I apologize for the horrible spelling in my
Subject. It should be "Creating a scrolling "Credits" form"

Comments below...
I'm trying to create a form that will display a list of
all the people who have helped me in my Access journey. I
will put this on my About form and it will be like a list
of credits for all the people who have helped me (which
would of course be everyone here). I got the idea from
the About form on a program called PcAnywhere which I use
frequently. The version I have (9) has three tabs on
their About form: General, Credits, and System Info. When
you click the Credits tab a list of all the developers
slowly scrolls up from the bottom to the top. Cool!

So I went searching everywhere for a similar type of
sample. I came across some samples from Roger
Carlson, Graham Seach, and Sensei Lebans, but they were
all horizontal scrolling text samples. I want my text to
scroll from bottom to top. Unbelievably I found in my
personal vast Access collection a file that does vertical
scrolling. I downloaded the file over a year ago! It is by
Pedro Gil and Sensei Lebans.

After lots of searching I found the download spot.
You can find it here:

http://www.geocities.com/pmpg98_pt/VerticalMarquee.html

I've been playing with it for quite sometime, but have a
couple of issues I cannot seem to resolve.
I'm hoping someone can help me solve the problems.

I've already made the table adjustments to my needs.
I have the font size at 8.
Here are the issues I am having:

1. I created a tab control on the form and moved the text
box to the bottom of the Credits tab. Right now I have
the tab control (called tabAbout) sitting a little bit
below the top of the Detail section. I'd rather not have
it all the way to the top of the Detail section. When the
credits start to roll everything is OK, but when they
reach the top of the tab control they actually push the
whole tab control to the top of the Detail section!!
Serious! I'd rather not have that happen! If I
go back into Design View the tabcontrol is still at .1146
(Top), but you'd swear the tab moves up when you're
viewing the credits!

This one was the most frustrating. No matter what I tried
the text box continued to "creep" up to the top of the
form and push the top of the tab control along with it.
After many trials and errors I resolved it by doing this:

Where the code had this:
Me.txtScroll.Top = Me.Section(acDetail).Height -
lngFontHeight

I put this:
Me.txtScroll.Top = Me.tabAbout.Height - lngFontHeight

That alone didn't solve it, but I thought I should leave
it in. I made the following change to the GetLineOut
function (sorry for line wrapping):

If Me.txtScroll.Top > lngFontHeight Then
If Me.txtScroll.Height + lngFontHeight > 3480 Then
'MsgBox "Reached Top"
Me.txtScroll = Mid$(Me.txtScroll, InStr(1,
Me.txtScroll, vbCrLf) + 2)
Else
Me.txtScroll.Top = Me.txtScroll.Top - lngFontHeight
Me.txtScroll.Height = Me.txtScroll.Height +
lngFontHeight
End If
Else
If Me.txtScroll.Top <> 0 Then
'only need to set it once
Me.txtScroll.Top = 0.2
End If
Me.txtScroll = Mid$(Me.txtScroll, InStr(1,
Me.txtScroll, vbCrLf) + 2)
End If

The second IF test was the key. I *think* I told Access to
basically stop the Height of the text box from growing
when it reached a cetain point in pixel distance from the
top.
2. A WaitTime in table design of 0 is too fast I think.
The names go flying by. A WaitTime of 1 seems a bit too
slow. So I changed the field to single and have .50 of a
WaitTime. That seems to be about right on speed. However,
any WaitTime other than 0 (that includes just 1) makes
the top of the tab control virtually disappear! The two
tab page captions virtually disappear as the names go
scrolling up! Not good! Is this a Painting issue?

This one was solved by testing various combinations of
WaitTimes and Timer Intervals. I settled on having all the
WaitTimes be zero again, but setting the Timer Interval to
500 instead of using 250. That did the trick. The names
creep up the screen at a reasonable speed, but there is no
disappearance of the tab pages. Nice.
3. I would like the names to continue scrolling up to the
top until they are completely out of view.
Right now once the last name comes up the whole list just
stops as it is designed to do. This seemed easy to fix
(so I thought). I added a bunch of dummy records with no
text so the list would keep scrolling but you wouldn't
see anything. However, this raises the Error 94 "Invalid
Use of Null" because the code apparently has to have
*something* in the text field. Darn! How can I get the
names to keep scrolling until they are out of sight?

This was the first one I solved. I forgot who is one of
your best friends in Access (besides all the people here):

Gool ol' NZ to the rescue!

In the GetLineOut function I changed this:
GetLineOut = rst!LineText

To this:
GetLineOut = Nz(rst!LineText)

Then I added a bunch of dummy records to the table as I
did before. I added just enough so the names continue to
scroll up to the top of the tab control and then out of
sight. The user is not aware more records are actually
being seen. Sweet.

After solving all these problems I came across one last
obstacle. My desire was to open the form to the first tab
page which would show "About" information. Clicking on the
Credits tab would start the names to scroll. If the user
clicks back to the About tab I wanted the names to stop.
That was easy enough to work out, but if you clicked back
to the Credits tab the names would start where they left
off! That's not what I wanted. I wanted the names to start
over again from the beginning.

This took forever to solve! I thought adding a simple
Me.txtScroll = vbNullString in certain places would do the
trick, but no such luck.

I eventually solved it by doing this:

1. Declared a boolean in the forms' Declarations area:
Dim blStartOver As Boolean

2. Added this code to the change event of the tab control:

Private Sub tabAbout_Change()
If Me.tabAbout.Value = 0 Then
' We're on the About tab
Me.txtScroll = vbNullString
Me.TimerInterval = 0
blStartOver = True
Else
' We're on the Credits tab
cmdStartScroll_Click
End If
End Sub

3. Added this code to the Form's Timer event before the
rest of the code:

If blStartOver = True Then
' We need to start over so clear everything
bolLast = True
blStartOver = False
Me.txtScroll = vbNullString
lines = 0
bolLast = False
End If

So the completed Timer code looks like this now:
(Sorry for line wrapping)

Private Sub Form_Timer()
Static lines As Integer
Dim bolLast As Boolean
Dim strTmp As String

If blStartOver = True Then
' We need to start over so clear everything
bolLast = True
blStartOver = False
Me.txtScroll = vbNullString
lines = 0
bolLast = False
End If

strTmp = GetLineOut(lines, bolLast)
Me.txtScroll.Value = Me.txtScroll.Value & strTmp & IIf
(bolLast, "", vbCrLf)

If bolLast Then
lines = 0
Else
lines = lines + 1
End If

End Sub

That did it!!
Now when you click back to the Credits tab the names start
all over again with Albert Kallal. Super Sweet!

Now I just need to make all the formatting changes I
desire, clean up the code a LOT, and add in some error
handling as well. Then it will be all set!
If anyone wants to see it after I'm finished just let me
know.

Thanks for the time.
 
Hi Jeff,
glad you got it working. I actually spent a few minutes tonight looking
at this issue. The only method I could find that would absolutely
guarantee a flicker free display involves writing directly to a Device
Context which as you know is not easy on an Access Form.
Send me your a sample MDB and I will be glad to post it on my site with
my HorizontalScroller solution.

I actually started programming by creating Teleprompting and
Title(Credit scrolling) software. I like your idea for the "Rolling
Credits" TAB.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Hi Sensei!
Hi Jeff,
Glad you got it working. I actually spent a few minutes
tonight looking at this issue.

I had a feeling you might play with this.
The only method I could find that would absolutely
guarantee a flicker free display involves writing
directly to a Device Context which as you know is not
easy on an Access Form.

....uhhhh "as I know"????

Sure Stephen, I knew that.....(looking like a deer in
headlights)...

The screen flickers just a bit, but it's tolerable I think.
Send me your sample MDB and I will be glad to post it on
my site with my HorizontalScroller solution.

Serious???!!
WOW, thanks! That was quite unexpected.

I just finished cleaning up everything and making some
final formatting adjustments. I decided to add a few dummy
rows at the beginning to allow people to read the message
on the left side first.

I'll send the 97 sample. Would you mind making a 2000
sample as well to post? I only have 97 with me at the
moment, but I think having both sample versions for
download would be good.

Thank you very much for this, it is most generous!
(head bowed)
I actually started programming by creating Teleprompting
and Title(Credit scrolling) software. I like your idea
for the "Rolling Credits" TAB.

Interesting, that's a real strange coincidence!

Thanks again for everything,
 
Hi Sensei!

I noticed that you placed the sample MDBs on your site recently.
Thanks again for the help and posting them!
 
Back
Top