Solved

How do I write code for the updown control??

Posted on 2000-03-12
2
151 Views
Last Modified: 2010-05-02
i need to write code using the updown control to increment or decrement a number.  The user enters a number in a textbox, then after the number is entered they have the option to increment the number or decrement it.  I got it to work for incrementing the number, the only problem is that when the down arrow is pressed it still increments the number.  Example: Private Sub UpDown2_Change()
 txtcentigrade.Text = txtcentigrade.Text + UpDown2.Increment
End Sub
I am hopeless, can anyone help me??
0
Comment
Question by:sf129
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 9

Accepted Solution

by:
Ruchi earned 75 total points
ID: 2611119
try something like this..

Private Sub UpDown1_DownClick()
Text1.Text = Text1.Text - UpDown1.Increment
End Sub

Private Sub UpDown1_UpClick()
Text1.Text = Text1.Text + UpDown1.Increment
End Sub
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2611156
The UpDown control has the following three events--
1. Change - occurs any time the Value property of the control is changed.
2. DownClick - occurs when you click the down arrow of the control
3. UpClick - occurs when you click the up arrow of the control.

Hope this helps you.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question