Create a new label on Access Report programatically

jackyccc

New member
Local time
Today, 14:55
Joined
May 2, 2008
Messages
3
I've been trying to create a new label on Access Report programatically during Run-Time with the following codes. But i kept getting the error message "Run-Time Error 29054 - Microsoft Office Access can't add, rename, or delete the control(s) you requested." Why?

FYI, i'm using Access 2003, and the following runs from a button click event on a form.


DoCmd.OpenReport Report_rTextInquiry.Name, acViewDesign, , , acHidden

Dim NewLabel1 As Control

Set NewLabel1 = CreateReportControl(Report_rTextInquiry.Name, acLabel, acDetail)


Can anyone help me on this issue? I've been trying for the entire afternoon. Millions thanks in advanced.
 
I don't know the answer, but why do you need to add a label on the fly?
 
instead of creating it

put a small empty label on, with cangrow set to true

then if you need it, make it visible
 
Gemma's solution is the easiest. You can only create a control on a report if it is open in design mode.
 

Users who are viewing this thread

Back
Top Bottom