It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Initial value of a text box VB

Moderator: dafunkymunky

Initial value of a text box VB

Postby enizag on Thu Apr 30, 2009 11:02 am

Hi there,

I have an issue with an application I am writing, I get information from a database, put the values into a label, then add up all the label values.
I use the following code to intialise the labels (12 of) :

Code: Select all
temp4 = main.ManualBonus1.contTarq2m1.Text
       If Not IsNumeric(temp4) Then _ main.ManualBonus1.contTarq2m1.Text = 0
temp4 = main.ManualBonus1.contTarq2m1.Text

I then add them up:
Code: Select all
temp = CInt(temp1) + CInt(temp2) + CInt(temp3)....

But this is where the error occurs as sometimes they have the value "NaN" in them which stops the calulation working. The value coming in from the database is always a number.
I get the following error:

OverflowException was unhandled

the calculation is done on Form Load and if a textbox is altered, and is contained within a User Control.

Any help would be gratefully appreciated.

Cheers

Enizag
enizag
 
Posts: 1
Joined: Thu Apr 30, 2009 10:42 am

Who is online

Users browsing this forum: No registered users and 2 guests