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

division in vb.

Status
Not open for further replies.

girfdl

Programmer
Aug 16, 2009
2
US
Private Sub Discount_AfterUpdate()
Dim strFilter As String

' Evaluate filter before it's passed to DLookup function.
strFilter = "DiscountID = " & Me!Discount

' Look up product's unit price and assign it to UnitPrice control.
Me!Discount_Pec = DLookup("DiscountAmount", "Discount", strFilter)
Me.Discount_Amount = Me.Subtotal * (Discount_Pec / 100)
End Sub

if i have a subtotal of 8.00
Me!Discount_Pec = 10
me.discount_amount is 1.00 instead of .80
 



Hi,

Is ms.discount_amount declared as an integer type rather than floating type?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
It is a text box in a access form. I am not sure how to set it as a float or integer.
 


Somethis is causing rounding.

Check in forum702.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top