ACC95: How to Bind a RichTextBox Control to a Field in a Table (148531)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
This article was previously published under Q148531 Advanced: Requires expert coding, interoperability, and multiuser skills.
SUMMARY
The Rich TextBox ActiveX control which is available with the Microsoft
Access Developer's Toolkit version 7.0 has no built-in property to bind its
contents to a field in the form's record source. However, you can use
Visual Basic for Applications to achieve the same result.
NOTE: The RichTextBox ActiveX control supplied with Microsoft Office 97,
Developer Edition has a ControlSource property which can be used to
directly bind its contents to a field in the form's record source. Although
the technique described in this article will work with the Microsoft
Office 97, Developer Edition Rich TextBox ActiveX control, we recommend
that you use its ControlSource property instead.
As you enter text in a RichTextBox ActiveX control, the formatting and the
text you enter is stored in the control's TextRTF property. This
information is stored in Rich Text Format (RTF). Using Visual Basic for
Applications, you can store the contents of the TextRTF property in a Memo
field in the underlying table.
NOTE: It is important to remember that you cannot view the form in
Datasheet view because the contents of the TextRTF property is stored in
the table. Viewing the data sheet of the form will generate a run-time
error.
This article shows the procedures that you can use to store the contents of
the Rich TextBox ActiveX control in the form's underlying record. This
simulates the ControlSource property that other controls have. The
procedures shown deal specifically with saving the contents of the
Rich TextBox ActiveX control, and does not touch on other Rich Text Format
issues covered in other articles (including controls that are used to
manipulate the Rich Text Format settings).
REFERENCES
For more information about the RichTextBox control, search on the phrase
"RichTextBox Control," and then search the appropriate topic, using the
Microsoft Office, Developer Edition Tools Help Index.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbhowto kbinterop kbProgramming KB148531 |
---|
|