subforms on reports

B

Bill B

Hi All

I'm pulling my hair out over trying to add a subform to a report I have.
I'll try to explain.

I have a report file that queries the DB and works fine. Nested in that
report I have a subform that queries the DB based on the ID of the parent
query. I'm getting the correct results from both queries but the nested form
isn't displaying like it should. In design view it looks like a form with a
header and below that the results of the query but when I run it the form is
displayed as a datatable. Looks like a raw dump of the query rather than the
form that is suppose to be displayed. I can't for the life of me see why or
what I've done or what I'm missing. It's like the form isn't being nested in
the report at all and that a standard data table is instead.

Any ideas where I might start to look for an answer??

Bill
 
D

Duane Hookom

I would never attempt to place a subform on a report. Try convert the subform
to a report and place the report on your main report. Make sure the Link
Master/Child properties are set.
 
B

Bill Betournay

Hi Duane

Thank you for the reply.

OK, so I have the form converted to a report and nested in my main report.
Now I seem to be having a problem passing my id variable into this new
subreport in order to query properly. The variable in question is named
ProjectID in the main report. The new subreport queries research data based
on that ProjectID. The record source for the subreport is populated with
this query:

SELECT DISTINCTROW ResearchPhases.Phase, ResearchPhases.CriticalVariables
FROM ResearchPhases
WHERE ResearchPhases.ProjectID=[ProjectID]
GROUP BY ResearchPhases.Phase, ResearchPhases.CriticalVariables;

[ProjectID] being the variable form the parent report. This doesn't work.
That variable isn't getting passed properly. What is the format or proper
way of passing, filtering of qualifying this query suppose to be in
subreports or forms??

Bill
 
D

Duane Hookom

You would pass the ProjectID filter to the subreport in the same way you set
up filtering a subform on a main form. Change the subreport record source to
the following and set the Link Master/Child to ProjectID.

SELECT DISTINCTROW ResearchPhases.Phase, ResearchPhases.CriticalVariables
FROM ResearchPhases
GROUP BY ResearchPhases.Phase, ResearchPhases.CriticalVariables;

--
Duane Hookom
Microsoft Access MVP


Bill Betournay said:
Hi Duane

Thank you for the reply.

OK, so I have the form converted to a report and nested in my main report.
Now I seem to be having a problem passing my id variable into this new
subreport in order to query properly. The variable in question is named
ProjectID in the main report. The new subreport queries research data based
on that ProjectID. The record source for the subreport is populated with
this query:

SELECT DISTINCTROW ResearchPhases.Phase, ResearchPhases.CriticalVariables
FROM ResearchPhases
WHERE ResearchPhases.ProjectID=[ProjectID]
GROUP BY ResearchPhases.Phase, ResearchPhases.CriticalVariables;

[ProjectID] being the variable form the parent report. This doesn't work.
That variable isn't getting passed properly. What is the format or proper
way of passing, filtering of qualifying this query suppose to be in
subreports or forms??

Bill
 
B

Bill Betournay

Thank you Duane. That did the trick

Very much appreciated. :)

Bill


Duane Hookom said:
You would pass the ProjectID filter to the subreport in the same way you
set
up filtering a subform on a main form. Change the subreport record source
to
the following and set the Link Master/Child to ProjectID.

SELECT DISTINCTROW ResearchPhases.Phase, ResearchPhases.CriticalVariables
FROM ResearchPhases
GROUP BY ResearchPhases.Phase, ResearchPhases.CriticalVariables;

--
Duane Hookom
Microsoft Access MVP


Bill Betournay said:
Hi Duane

Thank you for the reply.

OK, so I have the form converted to a report and nested in my main
report.
Now I seem to be having a problem passing my id variable into this new
subreport in order to query properly. The variable in question is named
ProjectID in the main report. The new subreport queries research data
based
on that ProjectID. The record source for the subreport is populated with
this query:

SELECT DISTINCTROW ResearchPhases.Phase, ResearchPhases.CriticalVariables
FROM ResearchPhases
WHERE ResearchPhases.ProjectID=[ProjectID]
GROUP BY ResearchPhases.Phase, ResearchPhases.CriticalVariables;

[ProjectID] being the variable form the parent report. This doesn't work.
That variable isn't getting passed properly. What is the format or proper
way of passing, filtering of qualifying this query suppose to be in
subreports or forms??

Bill




Duane Hookom said:
I would never attempt to place a subform on a report. Try convert the
subform
to a report and place the report on your main report. Make sure the
Link
Master/Child properties are set.

--
Duane Hookom
Microsoft Access MVP


:

Hi All

I'm pulling my hair out over trying to add a subform to a report I
have.
I'll try to explain.

I have a report file that queries the DB and works fine. Nested in
that
report I have a subform that queries the DB based on the ID of the
parent
query. I'm getting the correct results from both queries but the
nested
form
isn't displaying like it should. In design view it looks like a form
with
a
header and below that the results of the query but when I run it the
form
is
displayed as a datatable. Looks like a raw dump of the query rather
than
the
form that is suppose to be displayed. I can't for the life of me see
why
or
what I've done or what I'm missing. It's like the form isn't being
nested
in
the report at all and that a standard data table is instead.

Any ideas where I might start to look for an answer??

Bill
 

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