Vertical scrollbar only if needed

SunWuKung

Registered User.
Local time
Today, 10:46
Joined
Jun 21, 2001
Messages
172
Could somebody tell me how to have vertical scrollbar on the subform only if the data wouldn't fit and not otherwise? Most of the times it wouldn't be necessary and looks ugly, but than sometimes people couldnt scroll down when needed.

I know, I know not a major issue, but still...

Many thanks.
SWK
 
The vertical scroll bar will appear only if the subform vertical size does not display all the available records.
 
Yep,
that is what I thought too, but I just can't make it happen. It is a continuous form, maximised, all the records are in, no footer, tried to set all sorts of properties to all sorts of values (scrollbars, cangrow/shrink, autoresize, etc.) but I still have the vertical slider when it is unnecessary. It fills out all its space so you cant move it, but its there.

Any idea what to change?
Thnx.
SWK

[This message has been edited by SunWuKung (edited 08-24-2001).]
 
The only thing I can tell you is too go to the mainform design view and click and drag the vertical size of your subform until the scroll bar doesn't show in form view.
I have something simular and I have the scroll bar set to vertical only and then I had to tweak the sizing of the subform until it fit the way I wanted it to.
If there is another way I'm not aware of it.

Good luck

D.J.
 
Put this code in your Forms current event. Change as needed





Private Sub Form_Current()

' If the number of records in the subform
' is greater than 5, display the
' horizontal scrollbar.

If Me.RecordsetClone.RecordCount > 5 Then
Me.ScrollBars = 2
Else
Me.ScrollBars = 0
End If

End Sub





Me.scrollBars = 0 <<>> No Scroll Bars
Me.scrollBars = 1 <<>> Horizontal Only
Me.scrollBars = 2 <<>> Vertical Only
Me.scrollBars = 3 <<>> Horizontal and Vertical
 
It sound to me that in design mode of your subform you have pull your form footer way down the bottom limits of your subform.

Drag it up as far as you can and see what will happen.
 

Users who are viewing this thread

Back
Top Bottom