Looking for sample of VCR or Navigation buttons for use on UserForms

  • Thread starter Thread starter Phillips
  • Start date Start date
P

Phillips

I am trying to create a userform and want to use some type of navagation
buttons for moving between records. I like the looks of the
RecordNavigationControl, but can find NO documentation for it.

I am looking for something that will move first/last next/prev. I would
also like a "slider" and a GOTO REC

Any suggestions?

Thanks
 
add a scroll bar - use this as your slider
add four buttons

btnFirst '|<'
btnPrev '<'
btnNext '>'
btnLast '>|

add a horizontal scrollbar
sbSlider
add a label
lblRecordNumber SpecialEffect:=2 - sunken

add this code

Option Explicit
Private Record As Long
Private LastRecord As Long
Private Sub UserForm_Initialize()
'' populates key data
'for this demo
Record = 1
LastRecord = 100
With sbSlider
.Min = 1
.Max = LastRecord
.SmallChange = 1
.LargeChange = 10
End With
End Sub
Private Sub btnFirst_Click()
Record = 1
GetData
End Sub

Private Sub btnLast_Click()
Record = LastRecord
GetData
End Sub

Private Sub btnNext_Click()
If Record < LastRecord Then
Record = Record + 1
GetData
End If
End Sub

Private Sub btnPrev_Click()
If Record > 1 Then
Record = Record - 1
GetData
End If
End Sub
Private Sub sbSlider_Change()
Record = sbSlider.Value
GetData
End Sub

Private Sub GetData()
sbSlider.Value = Record

'''load data for Record
lblIRecordNumber.Caption = Record
End Sub


This demo shows the selected record number in the label.
It shows how to test for the first & last, and it sets
the value of the scrollbar according to the record buttons
The GetData procedure simply places the record number
into the label. It should quite easy to add boxes for
other data & use this to populate them
Use the form's initialise procedure to set up the min,
max etc as I have done.

demo file available - email me directly

Patrick Molloy
Microsoft Excel MVP
 
Using this approach, how do I position the activecell to the "record" in the
getdata?
This method would REALLY make my life easier!!!

Thanks
 
DOLT!!!!!

Range(record).Select

Silly me!


Phillips said:
Using this approach, how do I position the activecell to the "record" in the
getdata?
This method would REALLY make my life easier!!!

Thanks
 
Sample

Patrick

Is the offer still open of providing a sample with this type of navigation in it? Cheers.
 

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

Back
Top