Hiding Scroll Bars

D

DS

I want to hide a Vertical Scroll Bar on a SubForm to only show up when
needed. I did this code but it shows both Horizontal and Vertical, when
I make the subform bigger the horizontal scroll bar disappears but
leaves a grey space where it should be. Any way arounf this?
Thanks
DS

If Me.RecordsetClone.RecordCount > 6 Then
Me.ScrollBars = 3
Else
Me.ScrollBars = 0
End If
 
W

Wayne Morgan

If you size the subform control holding the subform to fit the subform,
you'll only get scroll bars when the number of records exceeds the visible
number of lines available in the subform control (basically, the same thing
you're doing with your code). I don't know of any way to get rid of the gray
area that is left when the scroll bar isn't there.
 
D

DS

Wayne said:
If you size the subform control holding the subform to fit the subform,
you'll only get scroll bars when the number of records exceeds the visible
number of lines available in the subform control (basically, the same thing
you're doing with your code). I don't know of any way to get rid of the gray
area that is left when the scroll bar isn't there.
Thanks Wayne. I played around awhile....I'm going back to a ListBox!
DS
 
T

Tom

DS

We had a similar problem & the way we got around it was a vertical label
whose width was that of the scroll bar & height that of the subform control.
By default its visible property was set to false.

With the code you are already using if the recordsetcount <= 6 the label's
visible property is set to true, if recordsetcount > 6 then the code sets
the visible property to false

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top