I have a question about subreports

G

Guest

i am trying to get 3 subreports onto a report. the main report has the
following fields; date, serialnum, materialname, baseserial, baseweight,
conserial, conweight, regserial, regweight, totalweight, plant, and initials.
i currently have a query that pulls in the data for the main report, using
the serialnum field as a criteria (entered on a form that open the report).
i am wanting 1 subreport to show data that has the same base serial number as
the field [baseserial] from the main report. then another subreport that
uses the field [conserial] from the main report as its criteria. then the
third subreport will use the field [regserial] from the main report as it's
criteria. is there a way of doing this? how? so far all i've been able to
get it to do is ask for the base serial number for each line it shows. is
there a better way of doing this than with subreports? how? thanks in
advance for any help you can offer.
 
G

Guest

Use the following criteria for the queries --
[Forms]![YourMainForm]![baseserial]

[Forms]![YourMainForm]![conserial]

[Forms]![YourMainForm]![regserial]
 
G

Guest

When i tried this, i set each of the queries up to pull data from the
original table (tblMixed). i set the parameter for the field to be
[reports]![rptFindSerial]![txtBaseSerial]. i set the data source for the
subreport to be the new query [qryFindSerialBaseSerial] the sql for this
query is listed below.

SELECT tblMixed.Initials, tblMixed.Plant, tblMixed.TotalWeight,
tblMixed.Date, tblMixed.SerialNum, tblMixed.BaseSerial,
tblMixed.MaterialName, tblMixed.BaseWeight, tblMixed.ConSerial,
tblMixed.ConWeight, tblMixed.RegSerial, tblMixed.RegWeight
FROM tblMixed
WHERE (((tblMixed.BaseSerial)=[reports]![rptfindserial]![txtbaseserial]));

i am now getting a no records dialog box that i had set up to tell when
there are no records. if i do a layout preview, i am getting the layout that
i want, except that the subreport is showing all the data (4 records) in
[tblMixed].

by the way, i am only working on the BaseSerial query and subreport right
now, i figure that once that one is done, i should be able to do the other 2.

KARL DEWEY said:
Use the following criteria for the queries --
[Forms]![YourMainForm]![baseserial]

[Forms]![YourMainForm]![conserial]

[Forms]![YourMainForm]![regserial]

jkendrick75 said:
i am trying to get 3 subreports onto a report. the main report has the
following fields; date, serialnum, materialname, baseserial, baseweight,
conserial, conweight, regserial, regweight, totalweight, plant, and initials.
i currently have a query that pulls in the data for the main report, using
the serialnum field as a criteria (entered on a form that open the report).
i am wanting 1 subreport to show data that has the same base serial number as
the field [baseserial] from the main report. then another subreport that
uses the field [conserial] from the main report as its criteria. then the
third subreport will use the field [regserial] from the main report as it's
criteria. is there a way of doing this? how? so far all i've been able to
get it to do is ask for the base serial number for each line it shows. is
there a better way of doing this than with subreports? how? thanks in
advance for any help you can offer.
 
G

Guest

disregard my previous post. i realized my error and have been able to get
the subreports working. thanks karl dewey for pointing me in the right
direction. the problem that i was having was i was setting the subreports
data source to just the query, as in "qryfindserialbaseserial subreport1",
instead of "Report.qryFindSerialBaseSerial subreport1". i was also forcing a
link between child and master fields. without this link the report is
working great.

jkendrick75 said:
When i tried this, i set each of the queries up to pull data from the
original table (tblMixed). i set the parameter for the field to be
[reports]![rptFindSerial]![txtBaseSerial]. i set the data source for the
subreport to be the new query [qryFindSerialBaseSerial] the sql for this
query is listed below.

SELECT tblMixed.Initials, tblMixed.Plant, tblMixed.TotalWeight,
tblMixed.Date, tblMixed.SerialNum, tblMixed.BaseSerial,
tblMixed.MaterialName, tblMixed.BaseWeight, tblMixed.ConSerial,
tblMixed.ConWeight, tblMixed.RegSerial, tblMixed.RegWeight
FROM tblMixed
WHERE (((tblMixed.BaseSerial)=[reports]![rptfindserial]![txtbaseserial]));

i am now getting a no records dialog box that i had set up to tell when
there are no records. if i do a layout preview, i am getting the layout that
i want, except that the subreport is showing all the data (4 records) in
[tblMixed].

by the way, i am only working on the BaseSerial query and subreport right
now, i figure that once that one is done, i should be able to do the other 2.

KARL DEWEY said:
Use the following criteria for the queries --
[Forms]![YourMainForm]![baseserial]

[Forms]![YourMainForm]![conserial]

[Forms]![YourMainForm]![regserial]

jkendrick75 said:
i am trying to get 3 subreports onto a report. the main report has the
following fields; date, serialnum, materialname, baseserial, baseweight,
conserial, conweight, regserial, regweight, totalweight, plant, and initials.
i currently have a query that pulls in the data for the main report, using
the serialnum field as a criteria (entered on a form that open the report).
i am wanting 1 subreport to show data that has the same base serial number as
the field [baseserial] from the main report. then another subreport that
uses the field [conserial] from the main report as its criteria. then the
third subreport will use the field [regserial] from the main report as it's
criteria. is there a way of doing this? how? so far all i've been able to
get it to do is ask for the base serial number for each line it shows. is
there a better way of doing this than with subreports? how? thanks in
advance for any help you can offer.
 

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