Could try Nz().
Is InvstID in the form's RecordSource?
=DSum("Share", "Ledgers", "InvstID=" & Nz([InvstID],0))
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Is InvstID in the form's RecordSource?
Yes, that's the killer in all of this in that all of the calculation expressions contain record field names that essentially do not exist until there's a record, hence the errors.
I was trying to complete the development of this form using the "*" new line for data entry, largely for consistency with the rest of the user actions. I have other methods of introducing new records into a continuous form display and will pursue one of those methods if someone doesn't see a way to solve this.
Bill
Actually, simple calcs should not error. The textbox would show blank (Null). The issue is with the DSum() trying to do a calc with incomplete search criteria. I just confirmed this in my db. The error propagates to other calcs that use the DSum() calculated value.
I also verified that Nz() DOES resolve the DSum() error.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
=[tbCurrentValue]-DSum("[basis]","Ledgers","[InvstID] = " & nz(Forms!Portfolio!InvstID,0))
That did the trick on the 3 controls that used DSum.
Thanks,
Bill