Parent child properties

G

Guest

Two quick questions
1. What is the syntax to dynamically (using VBA) assign the parent/child
linked fields for a report and its sub reports. Sometimes I want a report to
link to the sub on 2 fields and sometimes 3 fields.

2. I have a report with 2 linked sub reports. THis linking worked fine in
an MDB, but I have recently upgraded to a project (ADP) and now the second
sub report linking is failing. THe fields are listed in the properties
window, but they are not actually linking (in preview) as they did in the
Access Db. I have not changed anything except the data source for the second
sub report is a stored proc, as is the datasource for the main report. The
sub report that is linking correctly, had a table as its datasource.

TIA !!
 
S

SA

Nickl:

1.) Me!SubReportControlName.Properties("LinkMasterFields") =
"Field1Name;Field2Name" and
Me!SubReportControlName.Properties("LinkChildFields") =
"Field1Name;Field2Name"

2.) The problem with sprocs is that fields are not returned until the sproc
is run, which can occur at different times within versions of Access (you
don't say which one you are using. Access 2000 has the most problem with
this. The fields, although available in design mode, may not be available
at run time by when the Report open event fires. This is likely causing the
linking problem. Can you have your sproc append a temp table and link to
the table. That way the fields will always be available...

If you want to look at one possible solution, do a google group search on
this group for a posted with the title "sub report not linking to main
report", posted on March 30, 2004
 
G

Guest

Thanks Steve,
I tried the temp table idea myself and it works fine, FYI I am using Access
2003.
And a million thank-yous for the answer to 1. I have tried to source the
code for this for a while, and a few hours of guesswork got me nowhere.
Thanks again
 

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