> >Then I recreated the stucture of my subform. So far it wourks great.
> >The only small glitch is that if patient had several visits, it pulls record
[quoted text clipped - 4 lines]
>
> John W. Vinson[MVP]
>SELECT Main.[Patient Name], Main.[Medical Record], Main.DOB, Main.Age,
>Main.[Initial Date], Main.Diagnosis, Main.[Refering MD], Encounter.Date,
[quoted text clipped - 3 lines]
>WHERE (((Main.[Medical Record]) In (SELECT Encounter.[Medical Record] FROM
>Encounter WHERE Date = [Enter date:])));
If you're using the join, you WILL get one record for each encounter -
and you're specifically asking to see each encounter date and
encounter type.
If you just want to see Patient info on this query (while displaying
encounter data on a subform, perhaps), simply use the Encounter table
only in the subform:
SELECT Main.[Patient Name], Main.[Medical Record], Main.DOB, Main.Age,
Main.[Initial Date], Main.Diagnosis, Main.[Refering MD]
FROM Main
WHERE (((Main.[Medical Record]) In (SELECT Encounter.[Medical Record]
FROM Encounter WHERE [Date] = [Enter date:])));
Note that Date is a reserved word (for the built in Date() function)
and is best avoided as a fieldname. I'd suggest calling it
EncounterDate.
John W. Vinson[MVP]
alexasha - 31 Oct 2005 15:09 GMT
Sorry for the delayed responce.
Removing
INNER JOIN Encounter ON Main.[Medical Record] = Encounter.[Medical
>Record]
converted linked encounter records to
Expr1: Encounter.Date, etc
Now when I try to open form it is asking me for parameter on every field in
the quiery. I do not think that it will work
> >SELECT Main.[Patient Name], Main.[Medical Record], Main.DOB, Main.Age,
> >Main.[Initial Date], Main.Diagnosis, Main.[Refering MD], Encounter.Date,
[quoted text clipped - 23 lines]
>
> John W. Vinson[MVP]
John Vinson - 31 Oct 2005 19:13 GMT
>Sorry for the delayed responce.
>Removing
[quoted text clipped - 4 lines]
>Now when I try to open form it is asking me for parameter on every field in
>the quiery. I do not think that it will work
Well, that ISN'T what I suggested.
Base the mainform on the patient table. Use controls on the mainform
to display patient information.
Base the subform on the encounter table. Use controls on the subform
to display encounter information.
If this isn't working as you expect, please post the SQL view of the
mainform's Recordsource, and that of the Subform's recordsource as
well.
John W. Vinson[MVP]