changing report property

liuec

Registered User.
Local time
Today, 13:41
Joined
Jun 23, 2011
Messages
25
Hello, I've asked this question in anther thread but here's it again since I'm still confused.

What's the proper command to modify control source of textboxes in existing reports? I'm will be running a loop modifying these textbox control sources in existing reports so i will be assigning variables in these names...

Thanks so much!


Edit: Here's the code that I'm trying and returning "This property isn't available in design view"



DoCmd.OpenReport rptName, acDesign

Reports(rptNM).Controls("TextBox13").ControlSource = "qry_EmailList"

DoCmd.Close acReport, rptName, acSaveYes
 
Last edited:
That is correct, you can't do that in Design View via VBA so change it to...


Code:
DoCmd.OpenReport rptName

Reports(rptNM).Controls("TextBox13").ControlSource = "qry_EmailList"

DoCmd.Close acReport, rptName, acSaveYes


...though I am still unclear *exactly* why you are trying to do this in this manner. Maybe you could elaborate so we can better help you...
 
Thanks so much, here's the solution, the 1st line should be
DoCmd.OpenReport rptName acViewDesign
Then everything works!

:D


That is correct, you can't do that in Design View via VBA so change it to...


Code:
DoCmd.OpenReport rptName

Reports(rptNM).Controls("TextBox13").ControlSource = "qry_EmailList"

DoCmd.Close acReport, rptName, acSaveYes


...though I am still unclear *exactly* why you are trying to do this in this manner. Maybe you could elaborate so we can better help you...
 

Users who are viewing this thread

Back
Top Bottom