Case statement for unbound textbox

T

tripscott

I am creating an invoice where each product is totaled in an unbound
textbox call [LineTotal]. Here is the complicate part. The total is
based on certain conditions. I was able to do it just fine on the
form, but am having a hard time getting it to do it in the report.

First, if there is a discount I have to take that into effect. Second,
if there are multiple copies I give a 50% discount unless the hours
are 15 min (always $2.50) or 1 hour (always $10).

Anyone know what I should do??

Thanks, KS


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If PrintCount = 0 Then
cost = ([Hours] * [UnitPrice])

If [Discount] > 0 Then
DiscPrice = ([Hours] * [UnitPrice]) * [Discount]
Price = cost - DiscPrice
Else
Price = ([Hours] * [UnitPrice])
End If

If [Quantity] > 1 Then
Select Case linetotal
Case 0.25
Me![linetotal]= cost * [Quantity]
Case 0.5 To 1
extra = (cost * ([Quantity] - 1)) / 2
Me![linetotal] = extra + cost
Case Is > 1
Me![linetotal] = cost + ([Quantity] * 10)
End Select
End If

End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top