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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defaulting 0 to textbox value

Status
Not open for further replies.

nerdalert1

Programmer
Nov 4, 2004
92
US
I need to total textboxes going across. However I do not want to place a "0" in the textbox itself. Can I somehow default in my code that value to 0 without having to complete IF statements. Right now it goes (Cdbl(textbox1.text) + CDbl(textbox2.text).ToString

But one of the values could be blank and I want to make sure it adds as zero. Thanks all
 
Just assign each textbox value to a variable, check if it is null - if it is set it to zero.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top