Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / October 2004

Tip: Looking for answers? Try searching our database.

Report of Individual Record with Related Fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Les Coover - 20 Oct 2004 03:57 GMT
TableA 1 to many> TableB 1 to many> TableC
Referential Integrity Enforced, Cascade Update/Delete

Form has two subfroms.  Print Record Command
button on form.  As long as first subform has
the first record selected the hardcopy is correct
(Subform with correct associated SUBSUBFORM
records).  However, when subsequent subform
records are selected the current view "jumps
back" to the first subform record when the
print command button is clicked.  I have
struggled with this for many hours to no avail.

Do I need to create a report to do this?  How
to I create a report that will be "synchronized"
to the current view of my form?  I only need
that current view.  If I use the Print Screen
key and paste the copy into Word I get what
I want, but isn't there a better way to do this?

Thanks,

Les
Albert D. Kallal - 20 Oct 2004 05:23 GMT
Yes, you need to use a report, and just build sub-reports to mirror you
forms layout.

> Do I need to create a report to do this?  How
> to I create a report that will be "synchronized"
> to the current view of my form?

You might have to "code" the record source for the sub-reports.

You can use the on-open event of the sub-report

strSql = "select * from tblChild where main_id = " & forms!MainForm!ID

or, perhaps

strSql = "select * from tblChild where main_id = " &
forms!MainForm.MySubfromTableB!ID

me.RecordSouce = strSql

If the whole report can be correctly driven from the ONE main record, and
the "master/link child" fields..then you need NONE of the above.

And, the code to print only the current record in a report is:

me.Refresh
docmd.OpenReport "yourReport",,,"id = " & me.id

Signature

Albert D. Kallal   (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.attcanada.net/~kallal.msn

Les Coover - 20 Oct 2004 15:31 GMT
Thank you Albert for the help.

In the database I have tblAgencies 1 to many > tblDivisions
1 to many > tblAgents

I can make a report that will list Agencies with all related
divisions in the agency and for each division all related agents.

So here's the problem.  What I really want is just a "snapshot"
of a particular scenario.  The form provides this as when a
particular division is selected only the agents for THAT division
are shown (but there's the hardcopy problem).  So if I make
the report it will be lengthier than I need.

Second problem.  The advantage of the form is that it is easy
to quickly find an Agency and get associated information.  Now
if I want a hardcopy I have to go to the report scroll through
until I find the agency and then print that particular page.

Can you help me get started on this by showing me how I
can jump directly from the form to the record and then
print a "snapshot".

Thanks,

Les
> Yes, you need to use a report, and just build sub-reports to mirror you
> forms layout.
[quoted text clipped - 23 lines]
> me.Refresh
> docmd.OpenReport "yourReport",,,"id = " & me.id
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.