Slider Control

G

Guest

I am looking for example code & assistance for a slider control in access
2003. I want to move the slider up and down to make certain text & images
visible. As I slide again what was shown is hidden and other text & images
are visible.

Regards
Peter
 
D

Douglas J. Steele

With the form open in Design view, select Insert | ActiveX Control, and
select Microsoft Slider Control (I'd recommend the highest version number if
you've got more than one version in the list). Let's assume you rename that
ActiveX Control you just added something like sldSlider (and have positioned
it wherever you want on the form).

In the form's Load event, set the minimum and maximum values for the
control:

Private Sub Form_Load()
Me.sldSlider.Min = 1
Me.sldSlider.Max = 10
Exit Sub

In the Scroll event of the control, put your logic to control what text and
images should be visible dependent on the Value property of the control
(which, in the example above, will range from 1 to 10):

Private Sub sldSlider_Scroll()
Select Case Me.sldSlider.Value
Case 1
' Display whatever you want for the 1st value
Case 2
' Display whatever you want for the 2nd value

....

End Select
End Sub

If you right-click on the control while the form is open in Design mode,
you'll see that one of the options in the context-sensitive menu that
appears will be Slider Object. Select that, and you'll get a choice of
Properties. You'll see that there are a few other properties that you can
play with. Post back if you need help with any of those properties.
 
G

Guest

Thank You

Peter

Douglas J. Steele said:
With the form open in Design view, select Insert | ActiveX Control, and
select Microsoft Slider Control (I'd recommend the highest version number if
you've got more than one version in the list). Let's assume you rename that
ActiveX Control you just added something like sldSlider (and have positioned
it wherever you want on the form).

In the form's Load event, set the minimum and maximum values for the
control:

Private Sub Form_Load()
Me.sldSlider.Min = 1
Me.sldSlider.Max = 10
Exit Sub

In the Scroll event of the control, put your logic to control what text and
images should be visible dependent on the Value property of the control
(which, in the example above, will range from 1 to 10):

Private Sub sldSlider_Scroll()
Select Case Me.sldSlider.Value
Case 1
' Display whatever you want for the 1st value
Case 2
' Display whatever you want for the 2nd value

....

End Select
End Sub

If you right-click on the control while the form is open in Design mode,
you'll see that one of the options in the context-sensitive menu that
appears will be Slider Object. Select that, and you'll get a choice of
Properties. You'll see that there are a few other properties that you can
play with. Post back if you need help with any of those properties.
 

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