Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Sat, 16 Aug 2008 10:45:00 -0700,    group: microsoft.public.access.forms        back       


Pulling information from master/detail tables for report   
The heading basically says it all. I have finished the master and detail 
tables and forms. Now I need to be able to print a report based on my 
selection from the master table, obviously including the corresponding info 
from the detail table. 

I'd like to be able to do my selections from within a new form. Any 
suggestions?


ps: Thanks for all the help so far. You guys have been a big help.
date: Sat, 16 Aug 2008 10:45:00 -0700   author:   Jacques Steinman

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us