DSum Question

G

Guest

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
 
S

Steve

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
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Format Problem 4
DSum Problem 2
dsum error message 5
Dsum is killing me 1
Dsum Issues 0
DSum #Error 4
Help with DSUM syntax in a Textbox 1
More Dsum problems 1

Top