Avatar of PeterBaileyUk
PeterBaileyUk
 asked on

slider in access

I would like a slider that goes in value from 1 to 250, I have added the active x slider on the form but not sure how to get the slider to slide and return the new values the idea being that the user selects a value with the slider and then a filter is created from that value.
Microsoft Access

Avatar of undefined
Last Comment
Jeffrey Coachman

8/22/2022 - Mon
SOLUTION
Dale Fye

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
als315

Look at sample
PeterBaileyUk

ASKER
on the other tab I dont have those options unless its the wrong slider control: i have MSComctlLib.Slider.2 from slider control version 6 under active x controls
PeterBaileyUk

ASKER
its ok i found it in a sub section
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
SOLUTION
als315

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
PeterBaileyUk

ASKER
when i try to change the values it says invalid property, its under custom.
PeterBaileyUk

ASKER
Its strange if I just close the dialogue it accepts the change, it wont accept apply.
Dale Fye

"on the other tab I dont have those options unless its the wrong slider control"

Which options?slider control with options
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Dale Fye

Slider code
PeterBaileyUk

ASKER
Ok I am having trouble finding: select the slider control from the dropdown, then expand the events list and you will see the Change event.

I found on the left side the properties of bhpSlider (my name for it) I clicked the cross to open event but the hidden change event didnt appear.
ASKER CERTIFIED SOLUTION
Dale Fye

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
PeterBaileyUk

ASKER
I dont have that change event, i created a new slider control and the dropdown only has 5 events but no change event as far as I can see.

I tried adding manually:
Private Sub BHPSlider_Change()

    MsgBox "Changed" & Me.BHPSlider.Value

End Sub
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
als315

Dale, can you make a screenshot from Data tab of Silder control properties? A also have no Change event for this control and Other Tab looks different from yours
slider
Dale Fye

As I stated above, the Change event for the slider is only visible in the CODE window, not in the form design or in the Property Dialog.

1.  Open your form in Design view.
2.  Press Ctrl-G (this will open the VBA Code window)code window3.  At the top of that form, in the drop-down on the left, select the slider control (in your case, it should read "Slider1")
4.  In the Events drop-down, select the Change event.

The data tab on my properties window only has three entries:data tab
als315

Very strange, Class is the same. Can you show version of mscomctl.ocx (system32 or SysWOW64). I have version 6.1.98.34. Other tab for this control has only few options (it was cutted on previous screenshot, but there is only one line more)slider
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
PeterBaileyUk

ASKER
as it turns out i didnt need the change event, fortunately as I looked exactly where you said in the vba code window and the change event is not there. Anyway I only required the value of the slider and its worked perfectly well in my case. Still curious as to why the change event cannot be seen, I am in win 8, access 2010.
PeterBaileyUk

ASKER
I have split the points hope thats satisfactory to both.
Regards
Dale Fye

@als,

I'm using the system32 version of the Common Controls 6.0 (SP6).  But I'm not sure how to get the Version # of that.

@Peter,

You should also be able to get to the Min/Max values by right clicking on the slider control, then selecting the "Slider Object" -> Properties, then click the "General" tab on the Slider Properties dialog.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Dale Fye

I guess I failed to see your reference to Win8, Access 2010.  Are you using 32 or 64 bit Office?
Jeffrey Coachman

But lets go back for a moment.

Why not just use the "Scroll Bar" control?
It does not have the fancy tickmarks, (they can be simulated easily with labels) but it does what you ask for...
<get the slider to slide and return the new values the idea being that the user selects a value with the slider and then a filter is created from that value. >
(Still can only access the Change Prop form VBA though...)

Sample attached...

Then you can filter with something roughly like this:
Dim lngValue As Long
lngValue = Me.ScrollBar0
Me.Filter = "SomeField=" & lngValue
Me.FilterOn = True

JeffCoachman
Database16.accdb
Jeffrey Coachman

image
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.