J
J Cermak
A common problem I battle with in MS Access 97 is this:
Say you have 3 tables: Table 1, Table 2 and Table 3. Each
have 2 fields: ID and Number. Now say you would like to
add all records with matching IDs and come up with a sum
for each ID. You can easily set up a query and create a
relationship between all 3 table's ID fields and sum the
number fields from each. But here lies the problem: If
table 1 has ID 1 and Table 2 has ID 1 but table 3 does
not, say table 3 is empty, then thequery will not work.
If you try adding them by displaying each table in a
seperate form and adding them on a 4th form, you get an
#error in the sum field.
There must be a solution that will add only the fields of
the tables that exist. The only way I can get it to work
is to make sure the ID exists in all tables and is 0 for
ones with no value, then using Nz for each field, but
this makes the database large and wastes space.
Does anyone know code or commands that can work around
this?
Thanks!
Say you have 3 tables: Table 1, Table 2 and Table 3. Each
have 2 fields: ID and Number. Now say you would like to
add all records with matching IDs and come up with a sum
for each ID. You can easily set up a query and create a
relationship between all 3 table's ID fields and sum the
number fields from each. But here lies the problem: If
table 1 has ID 1 and Table 2 has ID 1 but table 3 does
not, say table 3 is empty, then thequery will not work.
If you try adding them by displaying each table in a
seperate form and adding them on a 4th form, you get an
#error in the sum field.
There must be a solution that will add only the fields of
the tables that exist. The only way I can get it to work
is to make sure the ID exists in all tables and is 0 for
ones with no value, then using Nz for each field, but
this makes the database large and wastes space.
Does anyone know code or commands that can work around
this?
Thanks!