Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB6 Convert textbox negative amount in positive

Posted on 2006-07-14
3
Medium Priority
?
406 Views
Last Modified: 2008-02-01
Sir, I have two textbox on my form one for user entering second one for getting information from first one textbox and save into database

If the user enter data in minus (-100) then first one textbox also get, and show negative amount (-100) as per my system (scenario) first textbox is right but I want when the second textbox get information from first textbox it automatically convert from negative to positive amount. Please help how to do this.
Rgds.
Mehram

0
Comment
Question by:Mehram
  • 2
3 Comments
 

Author Comment

by:Mehram
ID: 17106319
Revised
--------
Sir, I have two textbox on my form one for user entering second one for getting information from first one textbox and
save into database

If the user enter data in minus (-100) then second one textbox also get, and show negative amount (-100) as per my system (scenario) first textbox is right but I want when the second textbox get information from first textbox it automatically convert from negative to positive amount. Please help how to do this.
Rgds.
Mehram


0
 
LVL 44

Accepted Solution

by:
bruintje earned 2000 total points
ID: 17106327
Hi Mehram,
----------

you could use the ABS function like

if IsNumeric(Text1.Text) then Text2.Text = Abs(Val(Text1.Text))

----------
bruintje
share what you know, learn what you don't
0
 

Author Comment

by:Mehram
ID: 17106379
Tks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Loops Section Overview

877 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