Question : Error when assigning value to textbox in footer during runtime

Access won't let me change the value of a text box in a report footer using VBA. Here's my code within the page footer OnFormat event.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
     Me.txtGrpPages = "New text in footer textbox"
End Sub

When I preview the report, I get the following MS Visual Basic error message:

"Run-time error 12448': You can't assign a value to this object."

What's causing this error? How do I get Access to let me change the value in a textbox in the page footer?

Answer : Error when assigning value to textbox in footer during runtime

Actually, I just found the answer myself. At design time, I had entered '="xxx"' into the Data=>Control Source field of the Properties sheet for the textbox. I just deleted the '="xxx"' so that there is no value in the Control Source field now. When I did that, it worked fine.
Random Solutions  
 
programming4us programming4us