A Scroll Bar Vanishing Trick

Tom Knight

New member
Local time
Today, 04:25
Joined
Apr 29, 2003
Messages
6
Can anyone help me finish off a rather annoying problem that i've been working on?

I've got a continuous subform which only usually has a few records in but can potentially contain loads (therefore requiring the scroll bar to rear it's ugly head!!)
I tried out a few ideas to make it dissapear... the first one was to put an invisible text box on the form which counted the number of records and changed the scroll bar property accordingly. The only thing with this was that i had to requery the form to change the counter. I won't bother explaining why, but that was a problem.
I thought there must be a VB solution so i got this down

Private Sub Form_Current()
Dim NoOfRecords As Integer
NoOfRecords = records.Count
If NoOfRecords > 10 Then
Me.ScrollBars = 2
Me.Repaint
Else:
Me.ScrollBars = 0
Me.Repaint
End If
End Sub

The "records.Count" bit is wrong, does anyone know the right bit of code to put in there... i can't bear the thought of that grey thing ruining my artistic flair anymore hehe...
cheers
 
Thanks mate.. i think that's solved a problem that quite a few people have posted about on here.
 

Users who are viewing this thread

Back
Top Bottom