This is my situation.
I have a form(Patient Form)with many subforms.
I want to create a button on the Patient form.
This button will generate a report for only the highlighted patient. The report should also include the information in the sub forms.
I hope i've explained myself better.
Thanx
Create a report exactly the same as the form, with all the same subreports as subforms, and the same query in the report. Create a button on the form and put your version of the following code (example only) in the On Click event:
Code:
Private Sub Button1_Click()
Dim Condition As String
Condition = "[PatientID] = " & Me.txtPatientID
DoCmd.OpenReport "Report1", acViewPreview, , Condition
End Sub
The above is just an example and obviously control and report names should be chanegd to your specific case.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.