|
|
|
date: Sat, 16 Aug 2008 10:45:00 -0700,
group: microsoft.public.access.forms
back
Re: Pulling information from master/detail tables for report
Actually, the approach for reports is near identical to a form.
Simply build your report based the "main" parent table, and for the details,
create a sub-report..and then drop that sub-report into the report (place it
in the details section...it will "grow" for each set of child records.
So, just like a form automatic displays the child records, the report will
do the same.
To print the current record (and the child details) that you looking at, you
can launch the report to the ONE record you are looking at with the
following code:
if me.dirty = true then
me.dirty = false
endif
' the above code forces a disk write of our data since that's what the
report is going to be based on
docmd.OpenReport "nameOfReport",acViewPreview,,"id = " & me!id
Replace "id" with the name of your primary key field (main form).
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
date: Sat, 16 Aug 2008 14:23:39 -0600
author: Albert D. Kallal
Re: Pulling information from master/detail tables for report
Where would I put the code?
"Albert D. Kallal" wrote:
> Actually, the approach for reports is near identical to a form.
>
> Simply build your report based the "main" parent table, and for the details,
> create a sub-report..and then drop that sub-report into the report (place it
> in the details section...it will "grow" for each set of child records.
>
> So, just like a form automatic displays the child records, the report will
> do the same.
>
> To print the current record (and the child details) that you looking at, you
> can launch the report to the ONE record you are looking at with the
> following code:
>
>
> if me.dirty = true then
> me.dirty = false
> endif
> ' the above code forces a disk write of our data since that's what the
> report is going to be based on
>
> docmd.OpenReport "nameOfReport",acViewPreview,,"id = " & me!id
>
> Replace "id" with the name of your primary key field (main form).
>
>
> --
> Albert D. Kallal (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@msn.com
>
>
>
date: Sun, 17 Aug 2008 02:04:01 -0700
author: Jacques Steinman
Re: Pulling information from master/detail tables for report
Nevermind my previous question. Got it working perfectly. thanks
"Jacques Steinman" wrote:
> Where would I put the code?
>
>
> "Albert D. Kallal" wrote:
>
> > Actually, the approach for reports is near identical to a form.
> >
> > Simply build your report based the "main" parent table, and for the details,
> > create a sub-report..and then drop that sub-report into the report (place it
> > in the details section...it will "grow" for each set of child records.
> >
> > So, just like a form automatic displays the child records, the report will
> > do the same.
> >
> > To print the current record (and the child details) that you looking at, you
> > can launch the report to the ONE record you are looking at with the
> > following code:
> >
> >
> > if me.dirty = true then
> > me.dirty = false
> > endif
> > ' the above code forces a disk write of our data since that's what the
> > report is going to be based on
> >
> > docmd.OpenReport "nameOfReport",acViewPreview,,"id = " & me!id
> >
> > Replace "id" with the name of your primary key field (main form).
> >
> >
> > --
> > Albert D. Kallal (Access MVP)
> > Edmonton, Alberta Canada
> > pleaseNOOSpamKallal@msn.com
> >
> >
> >
date: Sun, 17 Aug 2008 05:07:02 -0700
author: Jacques Steinman
|
|