Access Report with SubReports

S

Scorp16

I have a report with 10 subreports. The report and subreports all use the
same query and the subreports are all linked on the same parent/child field
(project name).

I want to be able to have the users filter the data by typing in the first 3
characters of Project Name but when I put that criteria in the query -- it
makes me type it 10 times (for each subreport).

How do I do it so I only have to put it in once?
 
M

Marshall Barton

Scorp16 said:
I have a report with 10 subreports. The report and subreports all use the
same query and the subreports are all linked on the same parent/child field
(project name).

I want to be able to have the users filter the data by typing in the first 3
characters of Project Name but when I put that criteria in the query -- it
makes me type it 10 times (for each subreport).


Stop using those quick and dirty parameter prompts.
Instead, create a form with a text box (named txtProject)
for the criteria value and a button that opens the report.
Then button's code would look like:

Dim stDoc As String
Dim stWhere As String
stDoc = "the name of the report"
stWhere = "[Project Name] Like """ & Me.txtProject & """"
DoCmd.OpenReport stDoc, acViewPreview, , stWhere
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top