Scrollbox

PC User

Registered User.
Local time
Today, 07:12
Joined
Jul 28, 2002
Messages
193
I need help to increment a scrollbox when I scroll up or scroll down. The scrollbox has currency values; so I would like to increment by the penny.

attachment.php
 

Attachments

  • Scrollbox.jpg
    Scrollbox.jpg
    33.6 KB · Views: 291
I'm not sure but what you are calling a "Scroll Box" looks suspiciously like a list box :confused:

If it is, it's probably not the best tool for the job, the only way you can get it to do what you want is to have a Row Source that contains that information ( not really practical).

You would be better off with a text box that has two buttons associated with it one a plus button and the other a minus button. In the code behind the plus button's On Click event put something like;
Code:
Me.TextBoxName = Me.TextBoxName + 0.01

then in the minus Button's On Click event put something like;
Code:
If Me.TextBoxName <> 0 Then
     Me.TextBoxName = Me.TextBoxName -0.01
End If
 
are these controls activex objects - i dont think they are native access ones
 
They are activex Microsoft Forms 2.0 SpinButtons.
 
As PC said, these are ActiveX Spinbuttons. ActiveX Controls don't expose most of their properties in the Property Sheet. You have to go into the Code Module and use the General dropdown box to select the control and the Declarations dropdown to select the event.

For the Spinbutton control you need to use the SpinUp and SpinDown events, like this:

Code:
Private Sub SpinButtonName_SpinUp()
 Me.TargetControlName = Nz(Me.TargetControlName, 0) + 0.01
End Sub
Code:
Private Sub SpinButtonName_SpinDown()
 Me.TargetControlName = Nz(Me.TargetControlName, 0) - 0.01
End Sub

TargetControlName must, of course, be Datatype/Formatted as Currency.
 
Now that is interesting!! I've never heard of that before. So there are more events available using your suggestion. Thanks very much. I learned something new and useful. So now I know that the properties popup doesn't have everything for an activex.
 
Not really sure why all of the ActiveX Control Properties aren't available thru the Properties Pane, except that they are external to Access, which is to say that they are actually small add-in programs. In my limited experience with them, in the early days of my development career, the needed properties were almost never available thru the Properties Pane, but only available thru the Code Module.
 

Users who are viewing this thread

Back
Top Bottom