Slider Control Not moving the records to next record on form

  • Thread starter Rich via AccessMonster.com
  • Start date
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
 
J

JethroUK©

unless i missing something - i think your code is fine - but it's in the
wrong event - it should be in slider_afterupdate (not form current)
 
M

Marcin

U¿ytkownik "Rich via AccessMonster.com said:
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

============================================================================
================
FULL LEGAL SOFTWARE !!!
Games, video, program, image, chat, questbook, catalog site, arts, news,
and...
This site it is full register and legal software !!!
Please download and you must register software !!!

PLEASE REGISTER SOFTWARE:
http://www.webteam.gsi.pl/rejestracja.htm
DOWNLOAD LEGAL SOFTWARE:
http://www.webteam.gsi.pl

Full question and post: http://www.webteam.gsi.pl

Contact and service and advanced technology:
http://www.webteam.gsi.pl/kontakt.htm
FAQ: http://www.webteam.gsi.pl/naj_czesciej_zadawane_pytania.htm

Please add me URL for you all site and search engines and best friends !!!

Me site:
SERWIS WEBNETI: http://www.webneti.gsi.pl
PORTAL WEBTEAM: http://www.webteam.gsi.pl
LANGUAGE: http://www.webneti.cjb.net
============================================================================
================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top