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

Calculating totals

Status
Not open for further replies.

Corinne

Programmer
May 15, 2001
146
0
0
US
Hi,

I have a fairly simple project that I'm having a problem with. I need to calculate a total based on the quantity inputted into a text box. The calculation is based on the following. First text box (RetAmt) will always default to 50 and the second text box (NoItems) will always default to 1. The user will have the option to change the NoItems at any time. I would like to show the amount in the RetAmt box to multiply by 50 each time the quantity is changed. ie:
if user enters 1 then result is 50 (default)
if user enters 2 then result is 100
if user enters 3 then result is 150

you get the picture.

I only want the two text boxes on teh form not 3. I would like the RetAmt box to change value base on the quantity the user selects. Anyone have any suggestions?

Thanks,
Corinne
 
In the NoItem changed event do this:

Private Sub txtNoItems_Change()
txtRetAmt.Text = cStr(val(txtNoItems.Text) * 50)
End Sub -Chris Didion
Matrix Automation, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top