Changing a textBox value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have a report which I want to be able to change its title dynamically
(using VB) when the report is opened.
I tried to write on the report_open event:

If ....
Me.title = "a"
Else
Me.title = "b"
End If

But I get a mssage that I'm not allowed to assign a value to this object
(runtime error 80020009).
Is there any way doing this?
thank you
 
dshemesh,

I think you need the report's Caption property, not Title.
Me.Caption = "a"
 
No, I'm talking about a textBox I added to the report. the textBox's name is
"title". I want to change the content of this textBox everytime I open the
report.

10x
 
Search the newsgroups or help for OpenArgs - you can set the title
dynamically using that.
 
Try place the code in the On Format event of the section containing the text
box. The text box must not have any control source.
 
Sorry, Dshemesh, I misunderstood your original question.

In addition to Duane's suggestion, another option might be to just set
the Control Source of the textbox using an IIf() function or a Switch()
function, depending on the condition you are trying to apply in
determining the value of the textbox.
 

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

Back
Top