Totals in footer

T

Tom Knox

I have an unbound field in my Detail section. I update this field via VB
called by the On Format property of the Detail section. I named the field
"rental_fee". When I try to summarize this field in the Report Footer,
"=sum(rental_fee), I get the "Enter Parameter Value -- rental_fee" message.

How do I get a total of this field (rental_fee) in the Report Footer.

Any help would be appreciated.

Thanks

Tom Knox
 
K

Ken Snell \(MVP\)

In order to use Sum function, it must reference a field or fields in the
report's RecordSource query. You cannot use a control in the Sum function's
argument(s).

So, you likely need to change that unbound textbox to a calculated textbox,
where you put an expression in its ControlSource instead of using the VBA
progamming to put a value into the textbox.

If you give us more details about your report's RecordSource query and the
VBA code that you're using, we should be able to make specific suggestions.
 
T

Tom Knox

Ken

Thanks for response

I changed my record source to a table which I updated using a previous
routine. Your response got me on the right track

Thanks again

Tom
 
L

Larry Linson

Ken Snell (MVP) said:
In order to use Sum function, it must reference a field or fields in the
report's RecordSource query. You cannot use a control in the Sum
function's argument(s).

I'll add that, unless you jump through some hoops, calculations in VBA event
code may be repeated... that is, the Format and/or Print events may be
repeated, and may be performed in an order that isn't exactly what you'd
expect (at least, I discovered 'way back in Access 2 days that it wasn't
necessarily the order I would have expected). If it's a matter of simply
setting a control to a value, perhaps no promblem. But, if you are
accumulating a value / total, you may be accumulating more than you
expected.

I try to avoid calculations in Report event code for this reason. And when
I use them, I try to be very careful.

Larry Linson
Microsoft Access MVP
 

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