View Full Version : Vertical scrollbar only if needed


SunWuKung
08-24-2001, 10:09 AM
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

llkhoutx
08-24-2001, 10:26 AM
The vertical scroll bar will appear only if the subform vertical size does not display all the available records.

SunWuKung
08-24-2001, 03:34 PM
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).]

DJBummy
08-25-2001, 04:45 AM
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.

hooks
09-29-2004, 06:18 PM
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

aleb
09-30-2004, 12:36 AM
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.

SunWuKung
10-03-2004, 08:34 AM
That is a good idea hooks.
Thanks.

SWK