I have a budget application with two tables:
tblTitles: TitleID (key long int)
PastYrBudgetAmt
CurrentYrAmt
NextYrAmt
tblDetail: DetLinkID (matches TitleID)
DetailID
DetailDescription
DetailPastYr
DetailCurrentYr
DetailNextYr
There is a one to many relationship between these two.
I have two forms visible on my screen. The Title form is a multi-line form that I use to select the title wanted. The tblTitle is bound to this form. The Detail form is also a multiline . I have written code so that when I select one record on the title form, all of the Details are shown for editing or adding new ones.
The problem I have is that many of the Titles do NOT have Details, but DO HAVE a single dollar value for the title category itself. I could create a "dummy" detail for each one, but that seems like a lot of extra work inputing. What I would like to do is input these Title values directly (and keep them in the tblTitles) AND, where there are DETAILS, sum the details and then place the sum in the Titles table.
I KNOW it is not good practice to put calculated values into a table, but there are a number of reasons I want to do so in this application.
My real question is how do you Sum one form (based on a key field) and place the result in a table for another form.
I've run into not updateable query messages. Help suggests a DSUM function, but I can't get it to work. Any help would be appreciated.
tblTitles: TitleID (key long int)
PastYrBudgetAmt
CurrentYrAmt
NextYrAmt
tblDetail: DetLinkID (matches TitleID)
DetailID
DetailDescription
DetailPastYr
DetailCurrentYr
DetailNextYr
There is a one to many relationship between these two.
I have two forms visible on my screen. The Title form is a multi-line form that I use to select the title wanted. The tblTitle is bound to this form. The Detail form is also a multiline . I have written code so that when I select one record on the title form, all of the Details are shown for editing or adding new ones.
The problem I have is that many of the Titles do NOT have Details, but DO HAVE a single dollar value for the title category itself. I could create a "dummy" detail for each one, but that seems like a lot of extra work inputing. What I would like to do is input these Title values directly (and keep them in the tblTitles) AND, where there are DETAILS, sum the details and then place the sum in the Titles table.
I KNOW it is not good practice to put calculated values into a table, but there are a number of reasons I want to do so in this application.
My real question is how do you Sum one form (based on a key field) and place the result in a table for another form.
I've run into not updateable query messages. Help suggests a DSUM function, but I can't get it to work. Any help would be appreciated.
Last edited: