Log in

View Full Version : Division in vb



dgriffith
08-16-2009, 08:56 AM
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

CreganTur
08-17-2009, 05:13 AM
Welcome to the Forum- it's always good to see new members.

Unfortunately, just pasting code in a thread isn't going to get you any help. We need to know what your question is so we can give you the right kind of help.

Also, when you post code, please wrap it in VBA tags- click the green VBA button. This will format the code according to VBIDE and make it easier to read.

Thanks :thumb