C
Carol
First, thank you in advance for your help!
I have a form from which I want to run an append query for
all records in a table. The query append the date and
hour of service. If there is more than one hour, it
appends a record for each hour the patient is here. It
works great for the first patient, but I can't seem to get
it to advance to the next record and do the same thing.
Here is my code:
Do
Do While dtNextHour <= dtEndHour - 1
dtNextHour = dtNextHour + 1
Me.PTHour.Value = dtNextHour
If dtNextHour >= 24 Then
dtNextHour = dtNextHour - 24
dtEndHour = dtEndHour - 24
End If
DoCmd.OpenQuery stDocName, acNormal, acEdit
Loop
DoCmd.GoToRecord , , acNext
Loop Until IsNull(Me.PatientID.Value)
Thanks again,
Carol
I have a form from which I want to run an append query for
all records in a table. The query append the date and
hour of service. If there is more than one hour, it
appends a record for each hour the patient is here. It
works great for the first patient, but I can't seem to get
it to advance to the next record and do the same thing.
Here is my code:
Do
Do While dtNextHour <= dtEndHour - 1
dtNextHour = dtNextHour + 1
Me.PTHour.Value = dtNextHour
If dtNextHour >= 24 Then
dtNextHour = dtNextHour - 24
dtEndHour = dtEndHour - 24
End If
DoCmd.OpenQuery stDocName, acNormal, acEdit
Loop
DoCmd.GoToRecord , , acNext
Loop Until IsNull(Me.PatientID.Value)
Thanks again,
Carol