Access databases and VB

Moderators: Gogi
Number of threads: 767
Number of posts: 1599

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Format text using Rich Text Box and save to Access Posted by Tomdahawk on 27 Aug 2004 at 1:45 AM
I have designed a form with a Rich text box control on it and want the text typed in this box (duly formatted) to be saved in an Access database. How can i achieve this. I tried to save using the .rtftext option but the text is still not saved in the formatted manner. I am using a Memo type in the Access database table.

Also if there are buttons or other objects after the Rich Text Box controlm how can i disable the Tab key to jump to the other controls. i tried using the tabstop = false option for all the other objects. but now the user has to use the mouse to jump to the next textbox or command button. I wanted to enable the tabstop for each other object on the form and also enable the tab function within the rich text box so that the user can type tabular data and the same is then saved in Access in the same manner, because i have to print the data typed through the rich text box control.

Please help. This is very urgent.!!!!!

Thanks
Report
Re: Format text using Rich Text Box and save to Access Posted by jleg on 30 Aug 2004 at 4:16 PM
: I have designed a form with a Rich text box control on it and want the text typed in this box (duly formatted) to be saved in an Access database. How can i achieve this. I tried to save using the .rtftext option but the text is still not saved in the formatted manner. I am using a Memo type in the Access database table.
:
: Also if there are buttons or other objects after the Rich Text Box controlm how can i disable the Tab key to jump to the other controls. i tried using the tabstop = false option for all the other objects. but now the user has to use the mouse to jump to the next textbox or command button. I wanted to enable the tabstop for each other object on the form and also enable the tab function within the rich text box so that the user can type tabular data and the same is then saved in Access in the same manner, because i have to print the data typed through the rich text box control.
:
: Please help. This is very urgent.!!!!!
:
: Thanks
:
I have successfully done what you are trying to achieve in a project I am currently developing. I use an ado connection to an access data file with a memo field as my target / source of my rtf formatted data. Here is a sample of its use

AdodcPar.Recordset.Fields("RTFField") = RichTextBox1.TextRTF

I have also found an issue with creating a data source for the richtextbox control. "DONT", you are best to read in the data when required and write it back to the database when it has changed. I had problems when I gave the control a direct datasource using ado.

Anyway this works for me.

In answer to your second question. The std tab function does not work in a Richtextbox, but <ctrl> & <tab> does. I would suggest using something like the keypress event to catch the <tab> key stroke and replace it with <ctrl> & <tab> whilst the richtextbox has focus. This should work and stop it from losing focus to another control.

Hope this helps

John
Report
Re: Format text using Rich Text Box and save to Access Posted by kasmosh on 24 May 2007 at 1:43 PM
That was realy good. thank you



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.