RTF2 - Access Database Field

  • Thread starter Thread starter Kris M
  • Start date Start date
K

Kris M

Is it possible to access a database field in a RTF2 control? Example - I
have a report with one RTF2 control on it. In this control I would like to
pull the field [StudentName], which is in my report query, serval times in
the correct postion in text. Is that possible?

Thanks,
Kris M
 
If you mean can you Bind a field to the RTF2 control just like you can to a
TextBox control, then the answer is yes. DId you look at the Properties Page
for the control? The Data Tab page?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Yes, the RTF2 control is bound to a field to get the text. I am asking,
within that text, is it possible to access another access field and display
it withing the text.

So the RTF control is already bound to "RTFField" which stores the text I
need formatted. Is it possible to say put in another field, within that
text, say [FIRST_NAME] and have it display what is in the [FIRST_NAME] field
and not just '[FIRST_NAME]".

Thanks,
Kris M

Stephen Lebans said:
If you mean can you Bind a field to the RTF2 control just like you can to
a TextBox control, then the answer is yes. DId you look at the Properties
Page for the control? The Data Tab page?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Kris M said:
Is it possible to access a database field in a RTF2 control? Example - I
have a report with one RTF2 control on it. In this control I would like
to pull the field [StudentName], which is in my report query, serval
times in the correct postion in text. Is that possible?

Thanks,
Kris M
 
You would need to use the RTF2 control in an Unbound state. In the Current
event for a form and the Format event for a report you would have to
programmatically create an RTF encoded string that contains the contents of
the RTFField and the FIRST_NAME field.

Scroll down the RTF2 Web page and download the sample MDB from Andre
Minhorst of Germany. It will give you an idea of the coding involved.
http://www.lebans.com/richtext.htm
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Kris M said:
Yes, the RTF2 control is bound to a field to get the text. I am asking,
within that text, is it possible to access another access field and
display it withing the text.

So the RTF control is already bound to "RTFField" which stores the text I
need formatted. Is it possible to say put in another field, within that
text, say [FIRST_NAME] and have it display what is in the [FIRST_NAME]
field and not just '[FIRST_NAME]".

Thanks,
Kris M

Stephen Lebans said:
If you mean can you Bind a field to the RTF2 control just like you can to
a TextBox control, then the answer is yes. DId you look at the Properties
Page for the control? The Data Tab page?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Kris M said:
Is it possible to access a database field in a RTF2 control? Example -
I have a report with one RTF2 control on it. In this control I would
like to pull the field [StudentName], which is in my report query,
serval times in the correct postion in text. Is that possible?

Thanks,
Kris M
 
Back
Top