Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link two tables 1

Status
Not open for further replies.

slim2

Programmer
Oct 18, 2001
94
Crystal 8.5, ACCESS 2002.

I have a table from which the report is produced and a second unrelated table which contains percentage values used to calculate totals from table one. I cannot link the tables in visual linking because there are no matching fields. There is only one record in table two. Is there a way to get the values from tables 2 into the repoort to be used for calculations?

Thanks
 
Your option in this case is to use a subreport. It sounds like you will need the data to correspond (percentages matching up to fields). you have 2 options
1. insert the subreport as an unlinked report and just pass the values you need to have calculated via shared variables
2. create a formula in the main report that matches up to a field in the 2nd table that you are using for your subreport and link via this, thus creating corresponding data. Afterwards, you can pass values for calculation to the main report via shared variables. Shared variables aren't necessary unless you need to pass the data between the subreport and main report. (ie: if you are using the 2nd table for display purposes only, you will not need shared variables)
Cheers,
-Bruce Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
As it's is Access, can you create a query joining your original table to your one record table, and combine the fields from both tables.

Access will try an do a cartesian join between the two tables (I.e. no linked fields), but as it's only one record, it should be okay. The base your report on the query.

I've just tried it with some tables in an Access 2000 DB and it worked fine. Editor and Publisher of Crystal Clear
 
chelseatech,

Yes, that worked, thank you.

I have solved it with the subreport option but will keep this in mind in the future. Since I am new to Crystal and ACCESS, the subreport option allowed me to learn to do a subreport.

Unfortunately, the information provided by Crystal on the product is almost useless when trying to find out how to do something.
 
There is a lot of good stuff in the CR material. But as CR is such a powerful reporting tool, there are a lot of things you can do with it. Not every option or feature can be covered in full in the supporting material.

I was self taught for several years and then became an instructor. I didn't realise how little I knew back then. Like any complex piece of software, the more you use it, the more that you discover it can do.

The real experts on this Forum (Ken, Howard, Don, Ido, Bruce, etc - you know who you are) have many years experience and we are still learning new things. Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top