ACC2000: How to Control When Scroll Bars Are Displayed in a SubformID: Q207642
|
Moderate: Requires basic macro, coding, and interoperability skills.
You may want to display scroll bars in a subform only as needed. The
following function turns the scroll bars on or off according to a preset
number. The scroll bars do not appear unless the number of records in the
subform is greater than the preset number.
The following example demonstrates how to use an event procedure in the OnCurrent property of the subform to display or hide the scroll bars:
Private Sub Form_Current()
' If the number of records in the subform
' is greater than 4, display the
' horizontal and vertical scrollbars.
If Me.RecordsetClone.RecordCount > 4 Then
Me.ScrollBars = 3
Else
Me.ScrollBars = 0
End If
End Sub
For more information about the ScrollBars property, click Microsoft Access Help on the
Help menu, type "ScrollBars property" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
Additional query words: inf scrollbar visible hide
Keywords : kbdta FmsHowto
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: May 13, 1999