Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 spinbuttons on 1 textbox 1

Status
Not open for further replies.

JESTAR

Programmer
Feb 13, 2002
213
GB
Hi. I need to have 2 spinbuttons (MS Forms 2.0) working on 1 textbox. The first one controls the whole numbers, the second controls the decimals.

eg. Click the first one until the textbox = 5. Then click the second one seven times so the textbox = 5.7
 
Set Min = 0 and Max = 9 for both spin buttons and insert the following code. Here SpinButton1 controls the whole number part and SpinButton2 controls the decimal part.
___

Private Sub SpinButton1_Change()
Text1 = SpinButton1 & "." & SpinButton2
End Sub
Private Sub SpinButton2_Change()
SpinButton1_Change
End Sub
 
Just an afterthought:

This allows it to go up to 9.9. Is there a way to allow it to go up to 10.0 max? Changing spin1.max to 10 still allows for 10.9. Or, is there a way to tell if the user clicks the up or down of the spinbutton?
 
Yes you can change the Max value of SpinButton1 to the desired maximum value; and there are two events, SpinUp and SpinDown which tell if the user spins the button up or down.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top