Side by Side Sub Reports (?)

T

tbl

With the data fields of Id, Date, and a Text field for "AM"
or "PM", I'd like to have my report display a heading for
the month, and under that, two side-by-side columns, one
with a header for "AM", and one with a header for "PM",
under which the dates would file in.

So far, the best I've been able to do is staggered columns,
where "AM" comes first, then below that, "PM".


Here's what I'd *like* to see:


August

AM PM

8/1/2006 8/3/2006
8/6/2006 8/5/2006
8/13/2006 8/9/2006
8/28/200g 8/31/2006
 
M

Marshall Barton

tbl said:
With the data fields of Id, Date, and a Text field for "AM"
or "PM", I'd like to have my report display a heading for
the month, and under that, two side-by-side columns, one
with a header for "AM", and one with a header for "PM",
under which the dates would file in.

So far, the best I've been able to do is staggered columns,
where "AM" comes first, then below that, "PM".

Here's what I'd *like* to see:

August

AM PM

8/1/2006 8/3/2006
8/6/2006 8/5/2006
8/13/2006 8/9/2006
8/28/200g 8/31/2006


I think subreports might be a good idea.

Start by creating a query with all the needed data for the
subreport's record source:

SELECT datefield, ampmfield,
Format(datefield, "yyyymm") As YearMonth
FROM thetable

Then, create the report to use as the subreport so that it
displays all the records down the left side without regard
to the month or the am-pm value. Set this reports Sorting
and grouping to sort on the datefield.

Now create a query for the main report:

SELECT DISTINCT Format(datefield, "mmmm") As NameOfMonth,
Format(datefield, "yyyymm") As YearMonth
FROM thetable

Set the main report's Sorting and Grouping to sort on the
YearMonth field.

Add two text boxes to the detail section and bind them to
the two fields in the query. Make the YearMonth text box
invisible. Add two more text boxes (named txtAM and txtPM)
below the NameOfMonth text box, set the control source for
txtAM to ="AM" and the other to ="PM". Drag and drop the
subreport below txtAM. Set the subreport control's Link
Master Fields property to:
YearMonth,txtAM
and the Link Childs Fields property to:
YearMonth,ampmfield

Finally, drag a second copy of the subreport under the txtPM
text box and set its Link properties analogously.
 
T

tbl

I think subreports might be a good idea.

Start by creating a query with all the needed data for the
subreport's record source:

SELECT datefield, ampmfield,
Format(datefield, "yyyymm") As YearMonth
FROM thetable

Then, create the report to use as the subreport so that it
displays all the records down the left side without regard
to the month or the am-pm value. Set this reports Sorting
and grouping to sort on the datefield.

Now create a query for the main report:

SELECT DISTINCT Format(datefield, "mmmm") As NameOfMonth,
Format(datefield, "yyyymm") As YearMonth
FROM thetable

Set the main report's Sorting and Grouping to sort on the
YearMonth field.

Add two text boxes to the detail section and bind them to
the two fields in the query. Make the YearMonth text box
invisible. Add two more text boxes (named txtAM and txtPM)
below the NameOfMonth text box, set the control source for
txtAM to ="AM" and the other to ="PM". Drag and drop the
subreport below txtAM. Set the subreport control's Link
Master Fields property to:
YearMonth,txtAM
and the Link Childs Fields property to:
YearMonth,ampmfield

Finally, drag a second copy of the subreport under the txtPM
text box and set its Link properties analogously.

Thanks Marsh. I'll give that a spin as soon as I'm lucid
enough!
 

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

Similar Threads


Top