Query problem...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two suforms within a form. The first form is for Work Order details
such as, date, start and finish times, employees, miles driven, etc. The
second subform is for additional expenses such as, film developing costs,
mileage expenses, and various other expenses. When I run a query for the
invoice, the data is multiplied: ie, if there are 4 records in the Details
subform, and 2 records in the Expense subform, my query yields 8 records.
Does anyone know why this is happening? I will gladly send the database (500
Kb) if someone would or could take a look at it. I'm at a dead end. Thanks
in advance!
 
I'm not sure what you would expect to see in the query. This type of query
will not work unless the records from one of the related tables are
summarized down to a single record per record in the main table.

Just like you use subforms for viewing and editing the records, you would
use subreports to publish the records.
 
That may have answered my question. The two subforms are in datasheet view
and need to be scrollable vertically and horizontally because there's so much
related information for each record. But, I can't very well put a scrollable
datasheet on a report. The report (invoice) could have one record under
details and ten under Expenses, or a hundred under Details and none under
Expenses. I think I've normalized the table about as much as possible. Is
it acceptable practice to build a report with two or more queries?
And one more question...Do tables HAVE to be related to other tables? I
mean, can you have a "rogue" table?
 
Subreports are generally related to the main report through link
master/child properties. It shouldn't make any difference if you have 0 or
100 related records. They just all get printed.

A report can have only one record source. That is why we have subreports.

Yes, you can have "rogue" tables. For instance, you might have a table that
contains application version information.
 
Back
Top