View Single Post
  #5 (permalink)  
Old January 23rd, 2006, 11:50 AM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Is it possible you are experiencing a problem because the code is encountering an empty textbox? "" is probably causing the "invalid format" exception because an empty string is not numeric. Try creating a helper function that accepts the textbox as an argument and checks for an empty .Text property, returns 0 for that or returns the property value converted to an integer. Then just call the function for all textboxes you are going to add together.

-Peter
Reply With Quote