R
Rob M
Hi everyone,
I'm wondering whether someone can help with this.
I have a patient database that handles referrals from multiple
clinics. On main patient form, that contains a Referrals subform, I'm
trying to flag whether a referral to a specific clinic has been made.
The VBA code I have so far looks something like this:
--
Dim PatientIDTemp as integer
Dim ClinicFlag as boolean
PatientIDTemp = Me![PatientID]
NumberOfReferrals = DCount("[ClinicID]", "Referrals", "[PatientID] = "
& PatientIDTemp)
For b = 1 To NumberOfReferrals
(now I want to cycle through all the referrals for that patient, and
simply flag if the ClinicID = 8 (e.g., ClinicFlag = True)
Next b
--
It's easy enough to flag when there's only one referral (e.g., If
Referrals![ClinicID] = X Then ClinicFlag = True). The problem is that
I'm not sure how to cycle through all of the referrals to find the
particular one in question. Can anyone assist with coding this? I
may be way off base with what I have so far. I'd be really grateful
for any help.
Many thanks,
Rob
I'm wondering whether someone can help with this.
I have a patient database that handles referrals from multiple
clinics. On main patient form, that contains a Referrals subform, I'm
trying to flag whether a referral to a specific clinic has been made.
The VBA code I have so far looks something like this:
--
Dim PatientIDTemp as integer
Dim ClinicFlag as boolean
PatientIDTemp = Me![PatientID]
NumberOfReferrals = DCount("[ClinicID]", "Referrals", "[PatientID] = "
& PatientIDTemp)
For b = 1 To NumberOfReferrals
(now I want to cycle through all the referrals for that patient, and
simply flag if the ClinicID = 8 (e.g., ClinicFlag = True)
Next b
--
It's easy enough to flag when there's only one referral (e.g., If
Referrals![ClinicID] = X Then ClinicFlag = True). The problem is that
I'm not sure how to cycle through all of the referrals to find the
particular one in question. Can anyone assist with coding this? I
may be way off base with what I have so far. I'd be really grateful
for any help.
Many thanks,
Rob