J
John S. Ford, MD
I have a main form frmPatients with a subform sbfPatientAppointment. The
main form contains general information about a patient and the subform
contains information from a particular visit (appointment) with that that
patient.
The underlying table for the subform contains a primary field
PatientVisitIDNum.
I want to place a command button cmdPrintVisit on the subform and have it
open a report that is based ONLY on the information on the visit being
worked on (of the patient reflected in the main form). In other words, I
want to filter the report's underlying query to limit it only to the
PatientVisitIDNum of the visit being worked on.
I'm assuming I can use the DoCmd.OpenReport method using the wherecondition
argument where wherecondition = "PatientVisitIDNum =
currentPatientVisitIDNum". How do I populate the currentPatientVisitIDNum
with the correct value?
Any ideas?
John
main form contains general information about a patient and the subform
contains information from a particular visit (appointment) with that that
patient.
The underlying table for the subform contains a primary field
PatientVisitIDNum.
I want to place a command button cmdPrintVisit on the subform and have it
open a report that is based ONLY on the information on the visit being
worked on (of the patient reflected in the main form). In other words, I
want to filter the report's underlying query to limit it only to the
PatientVisitIDNum of the visit being worked on.
I'm assuming I can use the DoCmd.OpenReport method using the wherecondition
argument where wherecondition = "PatientVisitIDNum =
currentPatientVisitIDNum". How do I populate the currentPatientVisitIDNum
with the correct value?
Any ideas?
John