On form vhere you type new appointment fire Event AfterInsert:
(something like this one)
Private Sub Form_AfterInsert()
Dim lngAppointmentCount As Long
Dim intReminder As Integer
lngAppointmentCount = DCount("CustomerID", "Appointment", "CustomerID = " & Me.cboCustomerID.Value)
intReminder = lngAppointmentCount Mod 5
If intReminder = 0 Then
'make special price and save it
Else
'check the mormal price and save it
End If
End Sub
And I have one question. Where you store this special price? In Treatment table, or in other place?
Because, if you change the price in Treatment table, this is project on all treatments of all customers.
Maybe you make change on table A/V. Create there new field named ActualPrice, and when you typing new appointment, check the price from Treatment table, and insert new record into A/V table with TreatmentID, AppointmentID and really price (if your customer have discount then special price, or if haven't, then normal price form Treatment table).
Peko
|