Slider Control Updated Event doesn't trigger

G

Guest

In using the Activex Slider Control Ver 6 in Access 2002 (SP3) in a simple
colour generation form. It seems the Updated event does not trigger after I
release the slider at a new value on the scale. The Exit and LostForcus
events trigger, but only after I click in some other text box on the form.
I'd really like the control trigger an event as soon as it's updated so the
colour selection can be applied immediately.

The code at the OnExit (and at the inopertive Updated event) is simple
Me![ValRed] = Me![RedSlider]
Me![Label35].BackColor = Me![DecimalFromRGB]


Also, I'm not sure if this is related but the SelStart setting doesn't seem
to work either. I set it to 255 and in Design mode it seems to work, with the
slider moving to the right of the range, but when the form opens in form view
it has reverted to 0.

The SelStart glitch isn't serious but I would appreciate any help on the
Updated event. TIA
 
N

Norbert Bous via AccessMonster.com

Frank77 said:
In using the Activex Slider Control Ver 6 in Access 2002 (SP3) in a simple
colour generation form. It seems the Updated event does not trigger after I
release the slider at a new value on the scale. The Exit and LostForcus
events trigger, but only after I click in some other text box on the form.
I'd really like the control trigger an event as soon as it's updated so the
colour selection can be applied immediately.

The code at the OnExit (and at the inopertive Updated event) is simple
Me![ValRed] = Me![RedSlider]
Me![Label35].BackColor = Me![DecimalFromRGB]

Also, I'm not sure if this is related but the SelStart setting doesn't seem
to work either. I set it to 255 and in Design mode it seems to work, with the
slider moving to the right of the range, but when the form opens in form view
it has reverted to 0.

The SelStart glitch isn't serious but I would appreciate any help on the
Updated event. TIA

I assume that you come with the Change event rather to success. The preset
value is shown by the way perfectly in my form. Did you save the form before
testing it?

Option Compare Database
Option Explicit

Private WithEvents m_objSC As MSComctlLib.Slider

Private Sub Form_Load()
Set m_objSC = Me!Slider1.Object ' Slider1 is the name of the slider control
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set m_objSC = Nothing
End Sub

Private Sub m_objSC_Change()
Debug.Print "Change"
End Sub
 
G

Guest

Hi Norbert - thank you ... that works brilliantly. I'm still not clear why
the control's OnChanged event doesn't work (is there a bug in the control?)
but the WithEvents object variable responds correctly to Change so my
problem is solved.

Regarding the preset (SelStart), yes the changes are compiled and saved ..
other changes such a revising the range (from 1 - 10, to 0 - 255) and
revising the click increment, to 16, worked fine but the change to the preset
to 255 (or any other value) is always ignored once the form opens in form
mode.

I opted to set the slider start value in the form OnOpen event, so this
isn't really a problem.

Thanks for your help on this. .



Norbert Bous via AccessMonster.com said:
Frank77 said:
In using the Activex Slider Control Ver 6 in Access 2002 (SP3) in a simple
colour generation form. It seems the Updated event does not trigger after I
release the slider at a new value on the scale. The Exit and LostForcus
events trigger, but only after I click in some other text box on the form.
I'd really like the control trigger an event as soon as it's updated so the
colour selection can be applied immediately.

The code at the OnExit (and at the inopertive Updated event) is simple
Me![ValRed] = Me![RedSlider]
Me![Label35].BackColor = Me![DecimalFromRGB]

Also, I'm not sure if this is related but the SelStart setting doesn't seem
to work either. I set it to 255 and in Design mode it seems to work, with the
slider moving to the right of the range, but when the form opens in form view
it has reverted to 0.

The SelStart glitch isn't serious but I would appreciate any help on the
Updated event. TIA

I assume that you come with the Change event rather to success. The preset
value is shown by the way perfectly in my form. Did you save the form before
testing it?

Option Compare Database
Option Explicit

Private WithEvents m_objSC As MSComctlLib.Slider

Private Sub Form_Load()
Set m_objSC = Me!Slider1.Object ' Slider1 is the name of the slider control
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set m_objSC = Nothing
End Sub

Private Sub m_objSC_Change()
Debug.Print "Change"
End Sub

--
Norbert Bous


Message posted via AccessMonster.com
 

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