View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Phillips[_3_] Phillips[_3_] is offline
external usenet poster
 
Posts: 9
Default Looking for sample of VCR or Navigation buttons for use on UserForms

DOLT!!!!!

Range(record).Select

Silly me!


"Phillips" wrote in message
news:jytLb.4171$5V2.10163@attbi_s53...
Using this approach, how do I position the activecell to the "record" in

the
getdata?
This method would REALLY make my life easier!!!

Thanks







"Patrick Molloy" wrote in message
...
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




-----Original Message-----
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


.