|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can Add but Can't SubtractI Have a form set up with 2 Subforms on it.
At the bottom of the Main Form I have a Total field that grabs the totals from each of the subforms. It works fine when I add records, but when I delete a record the old number just lies there untill I add a new record. I put requery into the code but that doesn't seemm to work. Any help would be appreciated. Thank You DS On Thu, 24 Feb 2005 18:03:17 -0500, DS <booty***@optonline.net> wrote:
>I Have a form set up with 2 Subforms on it. Use Me.Recalc instead of Requery.>At the bottom of the Main Form I have a Total field that grabs the >totals from each of the subforms. It works fine when I add records, but >when I delete a record the old number just lies there untill I add a new >record. I put requery into the code but that doesn't seemm to work. >Any help would be appreciated. >Thank You >DS John W. Vinson[MVP] John Vinson wrote:
Show quote > On Thu, 24 Feb 2005 18:03:17 -0500, DS <booty***@optonline.net> wrote: I'll give it a try.> > >>I Have a form set up with 2 Subforms on it. >>At the bottom of the Main Form I have a Total field that grabs the >>totals from each of the subforms. It works fine when I add records, but >>when I delete a record the old number just lies there untill I add a new >>record. I put requery into the code but that doesn't seemm to work. >>Any help would be appreciated. >>Thank You >>DS > > > Use Me.Recalc instead of Requery. > > John W. Vinson[MVP] Thanks DS DS wrote:
Show quote > John Vinson wrote: I tried it and it didn't work...> >> On Thu, 24 Feb 2005 18:03:17 -0500, DS <booty***@optonline.net> wrote: >> >> >>> I Have a form set up with 2 Subforms on it. >>> At the bottom of the Main Form I have a Total field that grabs the >>> totals from each of the subforms. It works fine when I add records, >>> but when I delete a record the old number just lies there untill I >>> add a new record. I put requery into the code but that doesn't seemm >>> to work. Any help would be appreciated. >>> Thank You >>> DS >> >> >> >> Use Me.Recalc instead of Requery. >> >> John W. Vinson[MVP] > > I'll give it a try. > Thanks > DS Heres the DSum that I'm using... The TotMod is a calculated field...could that be the problem..? Me.Parent.[Mods Detail]!MDTS = nnz(DSum("[TotMod]", "Mods Detail Query", "[Order ID] = " & Me.Parent![Order ID])) Me.Parent!txtSubTotal = nnz(Me.ODT) _ + nnz(Me.Parent.[Mods Detail]!MDTS) Thanks DS On Fri, 25 Feb 2005 12:51:23 -0500, DS <booty***@optonline.net> wrote:
>Heres the DSum that I'm using... What's Mods Detail? And what's MDTS? The syntax>The TotMod is a calculated field...could that be the problem..? > >Me.Parent.[Mods Detail]!MDTS = nnz(DSum("[TotMod]", "Mods Detail Query", >"[Order ID] = " & Me.Parent![Order ID])) > Me.Parent!txtSubTotal = nnz(Me.ODT) _ > + nnz(Me.Parent.[Mods Detail]!MDTS) Me.Parent means the parent form - and the Me may be unneeded. I'd just use Parent!controlname Also, nnz is not a function which I recognize; is it a private version of Nz()? John W. Vinson[MVP] |
|||||||||||||||||||||||