Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Slider Control (Access 2003)

    G'day All
    I'm trying to use the slider control (MSComctlLib.Slider.2) in an Access Form. After the slider has been changed (mouse button released) I would like to update values in a text box on the form, reflecting the number the change of slider value has resulted in. However the "On Updated" event simply doesn't fire at all and the only events left associated with the control are LostFocus and Exit, which are occur only when the user clicks elsewhere. Other than these two events, is there any way I can update my text box with the new Slider.Value in a more real-time way? Is there another slider control out there with more events? And any ideas why the On Updated event does not fire?
    Regards Ken

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slider Control (Access 2003)

    Use the Change event. You won't see this in the Event tab of the Properties window, but if you click somewhere in the Updated event, you will be able to select Change from the Procedure dropdown list in the upper right part of the form module window.

    (Access doesn't list all available properties and events for non-native controls in the Event tab of the Properties window)

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slider Control (Access 2003)

    G'day Hans
    Thanks for that. I feel like I've lost my innocence. I never realised Access didn't display all the events - although I guess with ActiveX controls it's inevitable. Can you suggest a reference source for all the events for the various microsoft controls? After much searching, I managed to secure a copy of the chm file that has some of the properties and events but it does not seem complete, and did not have the change event.
    Thanks & Regards, Ken Pascoe

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slider Control (Access 2003)

    Hi Ken,

    Complete documentation for all VB controls can be found on the MSDN website: Visual Basic Documentation Map. For instance, for the slider control:

    Reference > Controls Reference > ActiveX Controls > Slider Control

  5. #5
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slider Control (Access 2003)

    G'day Hans
    Change event works a treat - thanks for that. If you have a moment - consider this problem.

    Based on whether the user has completed the task, the slider is either enabled or disabled. However I find that if a slider has been disabled, and I then enable it in code, it disappears from the form - replaced by a white block - different from not visible. If I subsequent make it not visible, then visible again - it shows up enabled. Any ideas why you can disable and enable a slider control?

    Code Sample :

    If MsgBox("Would you like to mark this task as Complete?", vbYesNo + vbQuestion, "Is this Task Complete?") = vbYes Then

    [CompleteDate] = Int(Now)
    [pctProgress] = 1
    [pctProgress].Enabled = False
    [ProgButtons] = 100
    [ProgButtons].Enabled = False
    [ProgBar].Value = 100
    [ProgBar].Enabled = False

    Else

    [pctProgress].Enabled = True
    [ProgButtons].Enabled = True
    [ProgBar].Enabled = True ' If disabled, this line causes the slider (progbar) to be replaced by a white box
    [ProgBar].Visible = False ' This and the subsequent line seem to bring it back again ...
    [ProgBar].Visible = True

    End If

    Thanks, Regards Ken

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slider Control (Access 2003)

    There is a bug in the way Access treats ActiveX controls. If you enable them, they move to the top left of the form, leaving a blank space behind. Just setting Visible = True is enough to correct this, you don't need to set Visible = False first.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slider Control (Access 2003)

    Touch

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slider Control (Access 2003)

    An update...
    I think the SCROLL event in the same drop down box is a better choice for real-time changes of the values in the associated text box, don't you?

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slider Control (Access 2003)

    If you want to update the value of the text box while the user is dragging the slider, you need the On Scroll event; On Change only occurs when the user has stopped dragging. If you want to execute lots of complicated code, using On Scroll might be problematic.

  10. #10
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slider Control (Access 2003)

    Yes, I guess it would be. But all I want to do is update the text box and so far there is no problem.
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •