I have a formA and subformB
subformB is a continous form with a txtTotal in form footer
=Sum([Total])
This works fine as long as there are records in form
but if form is null I get Error I would like to get around this as I
have a label to be Visible only if txtTotal>= 45000
The way it is now label shows up visible on form when it has no records
thank you for any suggestions
I know of no event which occurs when subform totals have been
calculated. There is invariably an indeterminate delay before one can
use a subform total in further expressions which leads to unpredictable
results. One can use the main form's timer event to do such work but
I've found a better approach is to compute the total in the main form's
current event for this purpose.
Assumptions:
1) The column being summed is named Item
2) The label you want to show or hide is on the subform
3) The linking index in both forms is named IndexID
4) The RecordSource of the subform is named SubTable
Use the following in your main form, formA:
Private Sub Form_Current()
Me!subformB!lbl Label.Visible = Nz(DSum("Nz(Sub Table!Item, 0)",
"SubTable", "IndexID=" & Me![IndexID])) >= 45000
End Sub
Sorry about the earlier confusion. I've really got to take more time to
ponder the question before offering a solution.
Thick Quinker - I just never learn.
*** Sent via Developersdex
http://www.developersdex.com ***