I have a form to enter an Booking for an adventure park. I have written a VBA procedure to calculate cost of a booking and work out any discount. This is a simple algorithm and works ok except that it places the right data into the wrong Form variable.
My code is as follows
The logic will calculate discount at 10% if the number in the party is greater than 9, else it should set discount as 0.
The results are
1. When I make the number greater than 9 the results in the form are correct.
2. When less than nine it puts the discount value in the total cost field and the Total Cost value into the Discount Field.
It also switches the values around using the MsgBox captures in the code.
This is illogical to me as the statement uses the same vairaibles for the If and the Else and appears to switch around giving the right values to the wrong variables.
Could anyone please put me out of my misery here?
My code is as follows

Code:
Dim Cost As Currency
Dim APrice As Currency
Dim Discount_Due As Boolean
Me.Disc = 0
APrice = Nz(DLookup("[ACost]", _
"[tblActivity]", _
"[AName] ='" & Me.Adventure & "'"))
"This gets the cost from Activity Table based upon Name of Activity Chosen"
Me.Price = APrice * Me.Num_in_Party
If Me.Num_in_Party > 9 Then
Me.Disc = Me.Price - (Me.Price / 10)
Me.Total_Cost = Me.Price - Me.Disc
MsgBox (Me.Disc & Me.Total_Cost)
Else
Me.Disc = 0
Me.Total_Cost = Me.Price - Me.Disc
MsgBox (Me.Disc & Me.Total_Cost)
End If
Me.Payment_Date = Me.Date_of_Booking
Me.Cust_Type = "Private"
MsgBox (" Booking Details Are Calculated")
End Sub
The results are
1. When I make the number greater than 9 the results in the form are correct.
2. When less than nine it puts the discount value in the total cost field and the Total Cost value into the Discount Field.
It also switches the values around using the MsgBox captures in the code.
This is illogical to me as the statement uses the same vairaibles for the If and the Else and appears to switch around giving the right values to the wrong variables.
Could anyone please put me out of my misery here?