I have a continuous form with an unbound text box that has a DSum function as
it's control source. It is used to display the sum of a field in a query. It
works fine except that the last line of my form (the one for a new record)
displays #Error in this text box. My DSum function is;
= DSum("SumOfFootprint", "qryBoxTotals", "BinID = " & [BinID])
I've tried assigning it to the text box control source through code;
Me.txtFootPrintSum.ControlSource = DSum("SumOfFootprint", "Query1", "BinID =
" & Me![BinID])
but then I get the #Name error in the text box. I've also tried adding nz to
my DSum but that doesn't make any difference (although I'm sure if I was
placing correctly in the DSum or not)
Maybe I need a statement like;
If Not Me.NewRecord Then... but I'm not sure.
Any suggestions would be appreciated. Thanks
Steve - 22 Jul 2007 00:29 GMT
Base your form on a query and use your DSum expression and create a
calculated field in the query. Assign this field to the control source of
your existing unbound text box. You won't have your problem any more!
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com
>I have a continuous form with an unbound text box that has a DSum function
>as
[quoted text clipped - 21 lines]
>
> Any suggestions would be appreciated. Thanks