Need help in calculating Quantity with Rate. I have Labels as:- Quantity, Rate, Amount, Total of Quantity and Total of Amount.
Text Box as Quantity Rate And Amount in 4 rows
What code I should write to get output in Amount, Total of Quantity and Total Amount
Vivek (viv345)
Edit by admin: no contact info permitted on the forum, thank you
Hello ...
Very precise explanation and precisions !
how many labels have you got ?
are they belonging to an indexed array group ?
What is Rate, exactly ?
I am afraid no one could answer without a very efficient crystal bowl !
Be very precise, please ... Il you are not able to do it with simple words, try with an example of your requirements :
- I have this (describe/show)
- and the result would be (describe/show).
Well it seems that you have more than one Text3 control... Do you know how I know this??? (Index As Integer)...
So, first make sure that you only have one text box control named Text3 and make sure its index property is a blank (has no value on property page). Then remove Index As Integer from your sub...
Please check the names of yll your textboxes and you will find mor than one textbox with the name of Text3. It seems that you might have created a TextBox array, possibly by incident without wanting that.
It becomes obvious because the change event of box Text3 gets the Index Parameter.
A normal TextBox event does not get a parameter supplied.
What you are supposed to do:
When you have located the Text3 boxes, give one of them a new name.
Then in bith of them remove the Index property. Simply delete the number in the property list.
Index property must be blank.
Then you reconsider Davids hint, that you dont want to change Text3 while it is already changing. This will create an endless loop.
The statement: Text3.Text = CStr(Val(Text1.Text) * Val(Text2.Text))
has to go to the Change() events of Text1 and Text2, not to Text3_Change() at all
In this way:
[Private Sub Text_Change()
Text3.Text = CStr(Val(Text1.Text) * Val(Text2.Text))
End Sub]
OR
[Private Sub Text1_Change(Text2.Text)
Text3.Text = CStr(Val(Text1.Text) * Val(Text2.Text))
End Sub]
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.