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?
views:
182answers:
1
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
2010-03-17 17:19:05
Where would you recommend putting that code?
David-W-Fenton
2010-03-17 20:02:10
I just dropped it into the Form_Load event of my subform. Works fine.
PowerUser
2010-03-17 20:12:19
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
2010-03-18 21:38:31