Devin Spilker said:
The table is for my monthly bills. My table is composed of fields in
which I have debitors. Each field is a seperate bill and each month the
amounts are different. I just want to be able to add the amounts
together for each month. Thanks again
Each separate bill should have it own record. You can assign an ID
to each debitor and then have a corresponding ID in the Bills table.
Here's an example of the table structures:
Table1: Debitor Table:
DebitorID <- Make this the Primary Key
Name
Address
AccountNo
Table2: Bills Table
DebitorID <- Make this an index but NOT unique.
DateOfBill
Amount
Set up a one-to-many relationship between the tables by linking the
DebitorIDs
For each entry in the Debitor Table, you can have none, one or as many as
you want in the Bills Table.
Now it's an easy matter to sum the Amounts by Date. Create a Query with
both table and the link
between the DebitorIDs in both tables. Add The DebitorID, Name and
Address fields from the Debitor
Table and the amount from the Bills Table to the query. Now make it a
Summary Query,
change the Amount column grouping type to Sum and put the following as its
criterion:
"#" & [Enter Date to be Summed] & "#"
Now when you run the query, it will ask for a date to be summed. put in
the date
and you'll see a sum for each debitor.
The way you have it now, you'd have to add fields to the table once you
fill up every payment slot.
With the two-table method, you can have thousands or even millions of
bills for every debitor
without having to change the table structures.
Tom Lake