News

Log In Sponsors
Partner Sites





Initial value of a text box VB



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:1bqqgh10]temp4 = main.ManualBonus1.contTarq2m1.Text If Not IsNumeric(temp4) Then _ main.ManualBonus1.contTarq2m1.Text = 0 temp4 = main.ManualBonus1.contTarq2m1.Text[/code:1bqqgh10] I then add them up: [color=#BF0000:1bqqgh10][code:1bqqgh10]temp = CInt(temp1) + CInt(temp2) + CInt(temp3)....[/code:1bqqgh10][/color:1bqqgh10] 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

Click here to read the whole forum topic