wolfbrother
Technical User
Hi Everyone, I have a form thats going to be used for scheduling chemotherapy appointments. I have a Datedue control, a freqency control( that is how often the patient will be getting treatment; entered in X many days) and a cycle control, how many times the patient will receive this particular treatment. What I'd like to be able to do is take the input from the user add the frequency of days to it and repeat that for the number of cycles making the code do all this automatically creating a new record for each entry that it enters, but I can't seem to get this to work at all.
Here's what I've tried
Public Function CalculateAppointments(datinidate As Date, intfrequency As Integer) As Date
CalculateAppointments = datinidate + intfrequency
End Function
then the function is fired off a command button which the user clicks to schedule the appointments based off the information he/she has entered.
Private Sub cmdscheduleapts_Click()
Dim datinidate As Date
Dim inifrequency As Integer
Set datinidate = Me![DATEDUE]
Set intfrequency = Me![frequency]
result = CalculateAppointments
Me!DATEDUE.Value = result
End Sub
As you can see I haven't even tried to get the repetion to work yet because I can't even get this to work. I know I'm probably way off on this, this is my first real attempt at using variables, Please Help!!!
Dave
Here's what I've tried
Public Function CalculateAppointments(datinidate As Date, intfrequency As Integer) As Date
CalculateAppointments = datinidate + intfrequency
End Function
then the function is fired off a command button which the user clicks to schedule the appointments based off the information he/she has entered.
Private Sub cmdscheduleapts_Click()
Dim datinidate As Date
Dim inifrequency As Integer
Set datinidate = Me![DATEDUE]
Set intfrequency = Me![frequency]
result = CalculateAppointments
Me!DATEDUE.Value = result
End Sub
As you can see I haven't even tried to get the repetion to work yet because I can't even get this to work. I know I'm probably way off on this, this is my first real attempt at using variables, Please Help!!!
Dave