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

wierd calculations given

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have two form fields that create a total calculation

My first form field dutysupertotals has 15 stored in it. the second numberofduties has 4 stored in it. The final form field has the following calculation and gives off wierd numbers. 33 and things like that. If I set the third box equal to say dutysupertotals it would show 1515 even though 15 is only displayed in dutysupertotals. Can someone help. Here is the calculation I have for the third box

=((dutysupertotals)/(numberofduties))
 
I don't see anything wrong with your formula.
What are your variables declared as?

I used the following code and it worked fine.

Dim dutysupertotals As Double: dutysupertotals = Val(TextBox1.Text)

Dim numberofduties As Double: numberofduties = Val(TextBox2.Text)

TextBox3.Text = (dutysupertotals/numberofduties)

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top