tags:

views:

182

answers:

1

I have a subform in an MS Access form which is not hiding/showing the vertical scroll bars as needed. In the example picture, the vertical scroll bar is showing even though there aren't enough records to warrant vertical scrolling. How do I get the scroll bars to show only when they are needed? Do I need to add an if-then condition to the on_load event? or is there an easier option?

Example

A: 

You may find something on these lines suits:

 If Me.Recordset.RecordCount > 10 Then
      Me.ScrollBars = 2 ''Vertical only
 Else
      Me.Scrollbars = 0 ''Neither
 End If
Remou
Where would you recommend putting that code?
David-W-Fenton
I just dropped it into the Form_Load event of my subform. Works fine.
PowerUser
If it's a subform with Master/Child links defined, you'd likely be better to put the code in the OnCurrent of the parent form.
David-W-Fenton