Hi all - Help please.
I am simply trying to store totals of transactions held in a table as child records, in the header records of another table which is essentially the parent. The UPDATE query I've made seems to work fine for some of the header records but not all and I don't know why it leaves some out.
Table1 is tblNOMINALS (one)
Table2 is tblAUDITTRAIL (many)
The link field is [NOMCODE] in both, ie [tblNOMINALS.NOMCODE] and [tblAUDITTRAIL.NOMCODE]
This is what I'm trying to do:
There is a field (named NOMDEBIT) in tblNOMINALS which needs to show the total of transaction values in a field (named also NOMDEBIT) in tblAUDITTRAIL, where there is a one to many relationship between tblNOMINALS AND tblAUTDITTRAIL.
My update query has the following in the update field of [tblNOMINALS.NOMDEBIT]:
[tblNOMINALS.NOMDEBIT]=[tblNOMINALS.NOMDEBIT]+[tblAUDITTRAIL.NOMDEBIT]
So I am trying to simply add up the records. As I say it works for some of the records in tblNOMINALS but not all and there's no apparent reason for leaving any out. I haven't done any selections at all. Incidentally, after running the query, header values that were previously "0.00" seemed to have been replaced with nulls, only in the records that didn't work.
I've run out of ideas. Am I approaching this the right way? I would appreciate some help.
Terry
I am simply trying to store totals of transactions held in a table as child records, in the header records of another table which is essentially the parent. The UPDATE query I've made seems to work fine for some of the header records but not all and I don't know why it leaves some out.
Table1 is tblNOMINALS (one)
Table2 is tblAUDITTRAIL (many)
The link field is [NOMCODE] in both, ie [tblNOMINALS.NOMCODE] and [tblAUDITTRAIL.NOMCODE]
This is what I'm trying to do:
There is a field (named NOMDEBIT) in tblNOMINALS which needs to show the total of transaction values in a field (named also NOMDEBIT) in tblAUDITTRAIL, where there is a one to many relationship between tblNOMINALS AND tblAUTDITTRAIL.
My update query has the following in the update field of [tblNOMINALS.NOMDEBIT]:
[tblNOMINALS.NOMDEBIT]=[tblNOMINALS.NOMDEBIT]+[tblAUDITTRAIL.NOMDEBIT]
So I am trying to simply add up the records. As I say it works for some of the records in tblNOMINALS but not all and there's no apparent reason for leaving any out. I haven't done any selections at all. Incidentally, after running the query, header values that were previously "0.00" seemed to have been replaced with nulls, only in the records that didn't work.
I've run out of ideas. Am I approaching this the right way? I would appreciate some help.
Terry