Populating Fields at Runtime

J

Jeff Harbin

I've got a report generated from a specific table. The report has a lot
of fields that are calculated from basic data that is stored in the
tables. I do not want to store the results of these calculations in a
table and thought I could generate them at run time.

When I open the report that has a subroutine in the Detail_OnFormat
event that is very basic (I'll make it more advanced once I prove out
the concept..) that assigns a value to three of the named calculated fields.

Me.Field1 = 2
Me.Field2 = 13
Me.Field3 = 7

I get an error message...

"You cannot assign a value to this object."

when I debug it brings me to the first line of the simple code.

Help...
 
D

Duane Hookom

You stated "assigns a value to three of the named calculated fields" which
doesn't make sense. First, the "fields" are probably text boxes. Second
"calculations" suggests they are bound to an expression. You can only assign
a value if the text box has no control source.
 
D

Duane Hookom

Could you provide your actual code (or a snippet)? You suggest they are "not
bound to any field". Does this also include any combination of fields or
other expressions?
 
Top