I have a one to many relationship between a table (tblPatients) whose primary key is "PatientID" and a second table (tblPatEncounter) which has "EncounterID" as its primary key field. The field "PatientID" is related in a one to many relationship with the second table (tblPatEncounter). The fields "PatFirstName" and "PatLastName" exist as text fields in the (tblPatient) table which contains the PK "PatientID". Upon opening the "tblPatEncounter" table I am able to view the PatFirstName & PatLastName values located in the "tblPatients" table by the following SQL statement:
SELECT DISTINCTROW tblPatients.PatientID, [PatLastName] & ", " & [PatFirstName] AS Patients
FROM tblPatients;
I am now attempting to create a form which is specific to the "PatientID" and is tied or bound to the "EncounterID" of the tblPatEncounter table. While I am able to do this successfully, I am only able to view the value of the PatientID in the form (i.e., 3,4,5,6) when I would like to see the values of PatFirstName & PatLastName which show up in the table as described above.
On a practical level - the form I am designing is to render information on an encounter with a patient. I would like to be able to select the encounter form by a combo box showing the patient's name. I am only able to create a combo box from this relationship that will reveal the (autonumber) assigned PatientID located in the original Patient table.
I have tried many combinations of SQL statements similar to the one above without success. I have also attemtped an unbound text box and unbound combo box.
Bottom line - Is there a way to do this?
Thanks, DAG :-D
SELECT DISTINCTROW tblPatients.PatientID, [PatLastName] & ", " & [PatFirstName] AS Patients
FROM tblPatients;
I am now attempting to create a form which is specific to the "PatientID" and is tied or bound to the "EncounterID" of the tblPatEncounter table. While I am able to do this successfully, I am only able to view the value of the PatientID in the form (i.e., 3,4,5,6) when I would like to see the values of PatFirstName & PatLastName which show up in the table as described above.
On a practical level - the form I am designing is to render information on an encounter with a patient. I would like to be able to select the encounter form by a combo box showing the patient's name. I am only able to create a combo box from this relationship that will reveal the (autonumber) assigned PatientID located in the original Patient table.
I have tried many combinations of SQL statements similar to the one above without success. I have also attemtped an unbound text box and unbound combo box.
Bottom line - Is there a way to do this?
Thanks, DAG :-D