I currently have have an form with a subform to manage a transaction. I have a button that calculates the total price of the order for all items purchased. (picture in attachment).
I am wondering whether it would be possible to add in a discount for 5 of any items (e.g 3 or item 1 and 2 of item 2); or whether having a discount for 5 of item 1 and 5 of item 2 would be easier to code.
The code that i currently have to calculate the total price for all items is:
I have no idea where to start with this discount and my understanding of code is not the best. Please help
I am wondering whether it would be possible to add in a discount for 5 of any items (e.g 3 or item 1 and 2 of item 2); or whether having a discount for 5 of item 1 and 5 of item 2 would be easier to code.
The code that i currently have to calculate the total price for all items is:
Code:
Private Sub cmdTotalPrice_Click()
Dim TotalPrice As DAO.Recordset
Dim db As Database
Set db = CurrentDb
Set TotalPrice = db.OpenRecordset("qryOrderLine", dbOpenDynaset)
TotalPrice.Edit
Do While Not TotalPrice.EOF
If (TotalPrice.Fields.Item("Sales ID").Value = Me!txtSaleID) Then
totalpricefororder = totalpricefororder + TotalPrice.Fields.Item("Total Price").Value
End If
TotalPrice.MoveNext
Loop
txtTotalPrice = totalpricefororder
End Sub
Comment