Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.
If anyone can shed some light on what is happening here I would be most grateful.
Public Sub ScrollListBox(ctlLst As Control, lngIndex As Long) Const strProcedure As String = "ScrollListBox" Dim LngThumb As Long Dim hWndSB As Long Dim lngRet As Long 10 On Error GoTo ErrorHandler 20 If lngIndex < 0 Then 30 lngIndex = 0 40 End If 'If lngIndex < 0 50 With ctlLst 60 If Not .ControlType = acListBox Then 70 GoTo ExitSub 80 End If 'If Not .ControlType = acListBox ' SetFocus to Listbox 90 .SetFocus '<==== 2110 Error here ' Now get the listbox's handle 100 hWndSB = GetFocus ' Set the window's ScrollBar position 110 LngThumb = MakeDWord(SB_THUMBPOSITION, CInt(lngIndex)) 120 lngRet = SendMessage(hWndSB, WM_VSCROLL, LngThumb, 0&) ' Select that row in the listbox 130 .Selected(lngIndex) = True 140 End With 'With ctlLst ExitSub: 150 On Error Resume Next 160 Err.Clear 170 Exit Sub ErrorHandler: 180 MsgBox "Error: " & Err.Description & " (" & Err & ") in procedure " & mstrModule & "." & strProcedure & " at line " & Erl 190 Resume ExitSub End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Form performance table vs. query||27||70|
|Access - Create a field on a form that is a lookup to an sql database and write the value to a table in access||1||55|
|How to build a logic for passwords according to initials?||13||51|
|nested if statement in access with null values||2||11|
Join the community of 500,000 technology professionals and ask your questions.