Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which form scrollbar was selected?

Status
Not open for further replies.

davidmreid

Programmer
Nov 30, 2001
16
0
0
US
Do you know how to determine which form scrollbar (horizontal vs. vertical) was selected when using a datasheet? Thank you
 
In the design view of the form look at the properties. Under the format tab there is scroll bars selection. Check to see what it is set to.
 
I am using the code (see below for a partial listing) from Stephen Lebans that I have modified to synch the horizontal scrollbar movement of two datasheets. However, I need to skip this process when the vertical scrollbar is used to view records--as this interrupts the conditional formatting I am using on the second datasheet.

'*************************************************
Private Sub Form_Timer() 'Access 2002-2003
'*************************************************
On Error Resume Next
'If scrollbar = horizontal then
If myCTL = "frm1" Then
Me.txtPos=fSetScrollBarPosHZ(frm1,fGetScrollBarPosHZ(frm2))
Else
Me.txtPos=fSetScrollBarPosHZ(frm2,fGetScrollBarPosHZ(frm1))
End If
'End If
End Sub

(This is not the exact code, but close enough--as I have reduced the syntax to fit this screen.)

I appreciate your help. Thanks!

David
 
You may want to use global variables to retain the positions then you can test to see which is different.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top