print report based on subform

Webster01

Registered User.
Local time
Today, 20:01
Joined
Mar 25, 2002
Messages
15
I have a form from which I print reports based on a single record. This works well when I use this form as a stand alone but when it is included as a subform, I get the message "Enter parameter value" The parameter that works when stand alone is Forms!Clinic Visit Record!PatiendID. What does this need to bring up the appropriate report when used a s a subform. Thanks.

The full line in question reads:

strDocName = "Clinic Visit Reocrd Query"

DoCmd.OpenReport stDocName, acViewPreview,,"[PatientID] = Forms![Clinic Visit Record]![PatientID]"

The main form is PatientDemographics and the two forms are linked through PatientID

[This message has been edited by Webster01 (edited 05-15-2002).]
 
You have to add the main form name as well
Forms!MainFormName!Clinic Visit Record!PatiendID
 
Excellent. It worked perfectly. Thanks
 
Oops. Now a new twist. Although this will now print a report based on a single PatientID number, it will print ALL reports based on that PatientID where I would like only the single report for that particular day. This is identified as [Visit Number] which is the primary index for the Clinic Visit Record. When I tried to substitute [Visit Number] for [PatientID] I recieved the same error message mentioned above.
 
Something like stLinkCriteria = "[Supplier]=" & "'" & Me![MatByMonth subform]![Supplier] & "'" assuming Visit number is text.
 

Users who are viewing this thread

Back
Top Bottom