Sum() issue

J

JimS

I have a text box in the header of a continuous form with the following
control source:

=Sum(Round(nz([BoMItemQty]*[tbHourlyRate]*[BoMItemUnitLaborHrs],0),2))

....BoMItemQty is a column in the form's record source
....BoMItemUnitLaborHrs is a column in the form's record source
....tbHourlyRate is a text box in the header of the form

I get a #Error

Ideas?
 
D

Dirk Goldgar

JimS said:
I have a text box in the header of a continuous form with the following
control source:

=Sum(Round(nz([BoMItemQty]*[tbHourlyRate]*[BoMItemUnitLaborHrs],0),2))

...BoMItemQty is a column in the form's record source
...BoMItemUnitLaborHrs is a column in the form's record source
...tbHourlyRate is a text box in the header of the form

I get a #Error

Ideas?


A Sum() expression can use only fields in the form's recordsource, not
controls on the form.
 
J

JimS

Hardly seems fair. Well, due to the properties of multiplication, I can just
move the text box multiplication out to the target text box. That worked.

I suppose I could have used a DSum() instead despite its high overhead.
--
Jim


Dirk Goldgar said:
JimS said:
I have a text box in the header of a continuous form with the following
control source:

=Sum(Round(nz([BoMItemQty]*[tbHourlyRate]*[BoMItemUnitLaborHrs],0),2))

...BoMItemQty is a column in the form's record source
...BoMItemUnitLaborHrs is a column in the form's record source
...tbHourlyRate is a text box in the header of the form

I get a #Error

Ideas?


A Sum() expression can use only fields in the form's recordsource, not
controls on the form.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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

Top