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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport picking wrong record

Status
Not open for further replies.

JuzzyD

Technical User
Apr 25, 2003
46
GB
I've got a database of projects which has worker's time and materials tables, separate tables and linked via a project number field.

I've created a project summary report that shows details of the project and brings in two subreports - one for any relevant time and one for any relevant materials for each project number - and I sum up the totals. The subreports run from queries which pull the data from the three tables.

I have a problem with the materials subreport in that for one particular project number, 111, it also calculates the values from project number 110 (but it only shows the materials for 111). If I alter the value of the materials for 110 it reflects in the total for 111.

It only happens for this one particular project number, and for the life of me I can't figure out why - running the query on its own only brings up the correct values, running the subreport on its own brings up the correct values and total, but running it within the main report it brings up the wrong total.

Can anybody shed some light on possible reasons for this?

The job number field is anumber field, long integer, with 0 decimal places.
 
Thanks for the quick reply!

I've checked the Ljnk Child and Link Master fields and they are fine - they're both set to the relevant job number field.

The data source for the subform is the materials query, which on its own runs correctly.
 
Does anybody else have any ideas?

If I delete all the relevant records in the tables and recreate them I get the same result so I'm beginning to think I've found a little bug in Access?
 
With a bit of investigation I've found that it only happens when the report is run from the switchboard, but if I open the report up directly it shows the correct values.

Does anybody know of an issue with the switchboard?
 
Is the switchboard grabbing the filter values from the proper places? If you view the OnClick event for that button you should get the general idea of where it's looking for data to filter by.
I don't know if it is trying to get the 2 different parameters that is causing the problem for you but it sounds like that would be a good starting place since you can determine that the report opens ok by itself.
-Jeff
 
I'm going to start a new thread on this - it appears to be more a printing issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top