Pls help me with this i need the answer this day please

One of the TextBoxes you're operating on in one of your conditions is blank; you cannot operate on it if that's the case.

Use this, instead:

Can u help me how to code this im just a newbie

Well? What do you want? I'm not a mind-reader, after all...

1 Like

You can also go with form validation before jumping to calculation part, here is a example code, you can take hint from.

Note: In your code everything is around TextBox1, TextBox2, ...3, it is hard to read, some meaningful name should have been given to them, isn't it?


So, your code must first test the text in each TextBox to ensure the User has entered a value. Since it seems you want them to enter numbers (Integers?) Set the Text Boxes to 'Numbers Only' (you can do that via the Designer Properties palette).

If a required value has not been entered, let the User know with a Notifier dialog.

Do not use 'Lost Focus', use one submit Button for all TextBox entries.

In that Button's clicked event Block, test for values in every TextBox, if yes, perform your calculations and update the results form, if no, tell the User.