Can Add but Can't Subtract

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

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
 
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]
 
DS said:
I'll give it a try.
Thanks
DS

I tried it and it didn't work...

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
 
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)

What's Mods Detail? And what's MDTS? The syntax

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]
 
Back
Top