Report doesn´t recognize text.caption

I

Ixak

I want to extract the info from a textbox in the open report event but I
don´t have the caption option there.
This textbox is in the header of a section.
How could I extract thise info?
Thanks
 
B

BruceM

Why do you need the Open event? Couldn't you just use the same Control
Source for both text boxes? Or you could use one of the text boxes as the
Control Source of the other:
=[OtherTextBoxName]
If you need to use a text box value as a label caption, you could do
something like this in the Detail section's *Print* event (assuming that the
label is in the Detail section):
Me.lblMyLabel.Caption = Me.MyTextBox
If neither option gets you where you need to go, you will need to provide
more explanation of what you want to do.
 
G

Guest

Text boxes do not have a Caption property. The contents of a text box is
retrieved with the Text or Value property. Since the Text property is the
default property, you can just use the text box Name. The following three are
equivalent and will store the string displayed in the text box named txtMyBox:

sWhatIsInTheBox = txtMyBox.Text
sWhatIsInTheBox = txtMyBox.Value
sWhatIsInTheBox = txtMyBox
 
I

Ixak

I continue without succeding.

All this I write I am doing it in open report, I don´t know if it is the
best place, but non of the choices have succeded.
My aim, more detailed is the next one. What I want to change is one of te
headers, this might cause a problem?

Hello
I have a textbox which contains the month and year.
It calculates as =Format$([soldmonth];"mmmm aaaa";0;0)
I´d like to obtain this information, august 2006 and convert it in another
textbox, in something else, another language.
something like

if soldmonth.caption or value = "august 2006" then
texttranslate.caption or text = abuztua 06
else
if soldmonth.caption or value = "june2006" then
texttranslate.caption or text = ....

Where and how should I write this code?
I mean, I don´t get with this options and I don´t know in which event I
should write them. When opening the form, or ...
Thanks
 
B

BruceM

The Open event will not work for what you are trying to do. In my first
response I said that you need to use the Print event. The Open event runs
once when the form is open. It does not run when you go to a different
record. More responses inline.

Ixak said:
I continue without succeding.

All this I write I am doing it in open report, I don´t know if it is the
best place, but non of the choices have succeded.
My aim, more detailed is the next one. What I want to change is one of te
headers, this might cause a problem?

Hello
I have a textbox which contains the month and year.
It calculates as =Format$([soldmonth];"mmmm aaaa";0;0)

Does this work? It looks as if you have combined the Input Mask syntax with
the Format function. There are some optional arguments in the Format
function for First Day of Week and First Week of Year, but I believe they
are separated by commas, and I can't think why you would want them anyhow.
Also, Year is "yyyy". What is [soldmonth]? Is it a Date/Time value?
I´d like to obtain this information, august 2006 and convert it in another
textbox, in something else, another language.
something like

if soldmonth.caption or value = "august 2006" then
texttranslate.caption or text = abuztua 06
else
if soldmonth.caption or value = "june2006" then
texttranslate.caption or text = ....

A text box does not have a caption, and a label does not have a value. You
can review the previous postings for the correct syntax.
Where and how should I write this code?

In the Print event, as described previously.
I mean, I don´t get with this options and I don´t know in which event I
should write them. When opening the form, or ...

Is it a form or report?
 
I

Ixak

Thanks for your help.
At last I have design a module in where I translate this. From the report I
call to this function and it translates depending on the value which is
written.
The syntax could be different as the language version of office I have is
spanish.
Thank you very much
BruceM said:
The Open event will not work for what you are trying to do. In my first
response I said that you need to use the Print event. The Open event runs
once when the form is open. It does not run when you go to a different
record. More responses inline.

Ixak said:
I continue without succeding.

All this I write I am doing it in open report, I don´t know if it is the
best place, but non of the choices have succeded.
My aim, more detailed is the next one. What I want to change is one of te
headers, this might cause a problem?

Hello
I have a textbox which contains the month and year.
It calculates as =Format$([soldmonth];"mmmm aaaa";0;0)

Does this work? It looks as if you have combined the Input Mask syntax
with the Format function. There are some optional arguments in the Format
function for First Day of Week and First Week of Year, but I believe they
are separated by commas, and I can't think why you would want them anyhow.
Also, Year is "yyyy". What is [soldmonth]? Is it a Date/Time value?
I´d like to obtain this information, august 2006 and convert it in
another
textbox, in something else, another language.
something like

if soldmonth.caption or value = "august 2006" then
texttranslate.caption or text = abuztua 06
else
if soldmonth.caption or value = "june2006" then
texttranslate.caption or text = ....

A text box does not have a caption, and a label does not have a value.
You can review the previous postings for the correct syntax.
Where and how should I write this code?

In the Print event, as described previously.
I mean, I don´t get with this options and I don´t know in which event I
should write them. When opening the form, or ...

Is it a form or report?
 

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

Top