Hi,
I created a form (frmPatient) which contains patient ID information and demographics. A pateint can have multiple mammographies on different dates. I have a button on frmPatient to open the mammographic findings form (frmMammo) and enter mammographic findings for a certain examination date (examDate). The primary key for frmPatient is PatientID (autonumber), the primary key for frmMammo is MamID (autonumber). PatientID is foreign key for MamID. They have a one-to-many relation.
Here is what I want to achieve: On frmPatient I want to add a button and a listbox. The button will trigger a query to show the dates of prior mammographic examinations on the listbox (if they exist) for the actual patient. To create the query, I think I'll have to use PatientID, MamID and examDate. For "On_click" property of the button I'll use a "Me.listbox.rowsource=" statement followed by the query statement. The problem is that I can't formulate the query. It is important for the query to show only the examination dates of the selected patient and not all of the patients. I tried the query wizard but it shows me all of the patients with a mammography and I don't know how to restrict it for a certain patient ID. I also don't know how to activate a query by pressing a button.
Any help would be very useful. Thanks....
I created a form (frmPatient) which contains patient ID information and demographics. A pateint can have multiple mammographies on different dates. I have a button on frmPatient to open the mammographic findings form (frmMammo) and enter mammographic findings for a certain examination date (examDate). The primary key for frmPatient is PatientID (autonumber), the primary key for frmMammo is MamID (autonumber). PatientID is foreign key for MamID. They have a one-to-many relation.
Here is what I want to achieve: On frmPatient I want to add a button and a listbox. The button will trigger a query to show the dates of prior mammographic examinations on the listbox (if they exist) for the actual patient. To create the query, I think I'll have to use PatientID, MamID and examDate. For "On_click" property of the button I'll use a "Me.listbox.rowsource=" statement followed by the query statement. The problem is that I can't formulate the query. It is important for the query to show only the examination dates of the selected patient and not all of the patients. I tried the query wizard but it shows me all of the patients with a mammography and I don't know how to restrict it for a certain patient ID. I also don't know how to activate a query by pressing a button.
Any help would be very useful. Thanks....