Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub Reposition(ByVal WhereTo As RepositionTypes)
With Data1.Recordset
Select Case WhereTo
Case MoveFirst
.MoveFirst
Case MoveLast
.MoveLast
Case MoveNext
If .EOF = False Then
.MoveNext
' to mimick the EOFAction property of the data control
If .EOF = True Then
.MoveLast
End If
End If
Case MovePrev
If .BOF = False Then
.MovePrevious
' to mimick the BOFAction property of the data control
If .BOF = True Then
.MoveFirst
End If
End If
End Select
End With
End Sub
Private Sub MouseWheel1_AfterMouseWheel(ByVal hWnd As Long, ByVal Delta As Long, ByVal Shift As Long, ByVal Button As Long, ByVal x As Long, ByVal y As Long)
If hWnd = m_hWndData Then
If Delta > 0 Then
If Button And vbMiddleButton Then
Reposition MoveFirst
Else
Reposition MovePrev
End If
Else
If Button And vbMiddleButton Then
Reposition MoveLast
Else
Reposition MoveNext
End If
End If
End If
End Sub
Private Sub MouseWheel1_BeforeMouseWheel(ByVal hWnd As Long, ByVal Delta As Long, ByVal Shift As Long, ByVal Button As Long, ByVal x As Long, ByVal y As Long, Cancel As Boolean)