robmkimmons
Technical User
I want to give my customers a discount when they purchase more. I have a pricing structure where after $800.00 they get 5% off of their purchase.
This is easily calculated with the following function in the unbound text box [Discount] on Form.frmOrders
=IIf([Subtotal]>800,0.05,0)
The problem I have is twofold: One, I want to add another discount of 10% if their purchase subtotal reaches $1,500.00. And two, I want to be able to personally override the discount amount if I choose to (eg. If they are at $1,499.00 I want to go ahead and give them the 10% discount).
My theory is to make the [Discount] text box bound to Table.tblOrders and use Else IF coding to determine the discount amount. I tried testing my theory with only one IF statement first to make sure I put the code under the correct event and it didn’t work. Is the code correct and just under the wrong event? Or is the coding wrong too? Any suggestions? Below is the coding I used.
Private Sub Subtotal_Change()
Dim DiscountAmount As Double
If Me![Subtotal] > 800 Then
DiscountAmount = 0.05
Else: DiscountAmount = 0
End If
Me.Discount = DiscountAmount
End Sub
Much thanks!
~Rob
If we expect the unexpected, does that make the unexpected... well, expected?
This is easily calculated with the following function in the unbound text box [Discount] on Form.frmOrders
=IIf([Subtotal]>800,0.05,0)
The problem I have is twofold: One, I want to add another discount of 10% if their purchase subtotal reaches $1,500.00. And two, I want to be able to personally override the discount amount if I choose to (eg. If they are at $1,499.00 I want to go ahead and give them the 10% discount).
My theory is to make the [Discount] text box bound to Table.tblOrders and use Else IF coding to determine the discount amount. I tried testing my theory with only one IF statement first to make sure I put the code under the correct event and it didn’t work. Is the code correct and just under the wrong event? Or is the coding wrong too? Any suggestions? Below is the coding I used.
Private Sub Subtotal_Change()
Dim DiscountAmount As Double
If Me![Subtotal] > 800 Then
DiscountAmount = 0.05
Else: DiscountAmount = 0
End If
Me.Discount = DiscountAmount
End Sub
Much thanks!
~Rob
If we expect the unexpected, does that make the unexpected... well, expected?