R
Rich via AccessMonster.com
I added a slider on my form. I need it to move to the next record, etc when
the slider is moved up or down. I added the following code , but the slider
does not move to the next record on the form.
Also, I have the following libraries: visual basic for applications;
Microsoft access 11.0 object library; Microsoft activeX objects 2.0 library;
OLE Automation.
The code is as follows……..
Dim fRecordCountChanged As Boolean
Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
fRecordCountChanged = True
End Sub
Private Sub Form_Current()
If fRecordCountChanged Then
Slider1.Max = Me.Recordset.RecordCount
fRecordCountChanged = False
End If
Slider1.Value = Me.CurrentRecord
End Sub
Private Sub Form_Load()
Slider1.Min = 1
Slider1.Max = Me.Recordset.RecordCount
End Sub
Private Sub Slider1_Scroll()
Dim lMove As Long
lMove = Slider1.Value - Me.CurrentRecord
If lMove <> 0 Then
With Me.RecordsetClone
.Move lMove, Me.Bookmark
Me.Bookmark = .Bookmark
End With
End If
End Sub
the slider is moved up or down. I added the following code , but the slider
does not move to the next record on the form.
Also, I have the following libraries: visual basic for applications;
Microsoft access 11.0 object library; Microsoft activeX objects 2.0 library;
OLE Automation.
The code is as follows……..
Dim fRecordCountChanged As Boolean
Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
fRecordCountChanged = True
End Sub
Private Sub Form_Current()
If fRecordCountChanged Then
Slider1.Max = Me.Recordset.RecordCount
fRecordCountChanged = False
End If
Slider1.Value = Me.CurrentRecord
End Sub
Private Sub Form_Load()
Slider1.Min = 1
Slider1.Max = Me.Recordset.RecordCount
End Sub
Private Sub Slider1_Scroll()
Dim lMove As Long
lMove = Slider1.Value - Me.CurrentRecord
If lMove <> 0 Then
With Me.RecordsetClone
.Move lMove, Me.Bookmark
Me.Bookmark = .Bookmark
End With
End If
End Sub