These are 2 examples.
In all cases, the form control source query returns 0 records.
In case 1 - Allow Additions is enabled on both subforms, and the main form calculation works as intended.
case 2 - Allow Additions is turned off on subform CF2. Now the CF2 subform subtotal returns NULL, which is not captured by either NZ() function on the subform, and the Main Form Total returns a #Type! error.
In my database, the queries are totaling rows, so you cannot add records.
So the New Record row in the dataset when the Allow Additions option is 'yes' allows the calculated textbox to work because a zero can be assigned on that record.
I've tried to use VBA to DCOUNT the records in the Query, but then I have the issue of a formula in the textbox.
I've tried using =IIf(Sum([PY3]) Is Null,0,Sum([PY3s])) ..
Tried checking if isNumeric. . nothing seems to work and I get #Type! returned.
Has anyone else ran into this? Is there a different approach you would take altogether to avoid the issue?
Please let me know if more info is needed. I've spend a lot of time trying correct this so any help is much appreciated.