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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically Manipulating Scroll Bars

Status
Not open for further replies.

sallieann

Programmer
Sep 2, 2003
28
GB
Can anyone tell me how to manipulate the scroll bar on a form? I want the user to be able to move the subform records (which are in continuous form view) down by clicking a button (almost so it appears like a new screen) rather than scrolling. Any feedback would be really appreciated.
 
Check out
Let us know if it helps

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
 
Hi Ben,

Many thanks for your help. Since posting my question I managed to find a piece of code that did the trick. Thanks for answering my question though. This is what I found;

'In the Form's General Declaration Section put:
Private Const WM_HSCROLL = &H114
Private Const WM_VSCROLL = &H115
' Scroll Bar Commands
Private Const SB_LINEUP = 0
Private Const SB_LINELEFT = 0
Private Const SB_LINEDOWN = 1
Private Const SB_LINERIGHT = 1
Private Const SB_PAGEUP = 2
Private Const SB_PAGELEFT = 2
Private Const SB_PAGEDOWN = 3
Private Const SB_PAGERIGHT = 3
Private Const SB_THUMBPOSITION = 4
Private Const SB_THUMBTRACK = 5
Private Const SB_TOP = 6
Private Const SB_LEFT = 6
Private Const SB_BOTTOM = 7
Private Const SB_RIGHT = 7
Private Const SB_ENDSCROLL = 8

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long


Code sample to call this function:

Private Sub cmdMove_Click()
Dim lVal As Long
lVal = SendMessage(Me.hWnd, WM_VSCROLL, SB_PAGEDOWN, 0&)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top