Control Source Prob.........?

  • Thread starter Thread starter KRISH
  • Start date Start date
K

KRISH

Hi! Everybody, Please help me........

My prob here:
I am storing control source of a report say "<some text> &
[Field1] & <some text here...>" in a table field say
[Para1]. Now I am assigning [Para1] as control source to
an unbound text box in my report say [Text1]. When I open
the report it is showing the code as stored in the table
field [Para1]. But actually I want in the output [field1]
should be replaced with the value of the field. kindly
help.

krish
 
KRISH said:
I am storing control source of a report say "<some text> &
[Field1] & <some text here...>" in a table field say
[Para1]. Now I am assigning [Para1] as control source to
an unbound text box in my report say [Text1]. When I open
the report it is showing the code as stored in the table
field [Para1]. But actually I want in the output [field1]
should be replaced with the value of the field. kindly
help.


Not much you can do with this kind of thing. The mechanisms
that evaluate expressions are unaware of control/field names
without specifying their containing object.

If you are willing to set Para1 to:

"<some text>" & Reports!thereport.Field1 & "<more text>"

and add an (invisible?) text box bound to Field1 to the
report's detail section, then the Text1 text box can use the
expression:

=Eval(Para1)

to get the effect you're looking for.

If all that is not acceptable to you, then you should use
code to parse out the field name and Replace it with the
value of the corresponding field. A very simple minded
example that can be done in the Text1 text box expression
could be:

=Eval(Replace(Para1,"[","Reports!thereport!["))
 
Back
Top