Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Format text using Rich Text Box and save to Access

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

Comments

  • jlegjleg Member Posts: 237
    : 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 & does. I would suggest using something like the keypress event to catch the key stroke and replace it with & whilst the richtextbox has focus. This should work and stop it from losing focus to another control.

    Hope this helps

    John ;-)
  • kasmoshkasmosh Member Posts: 1
    That was realy good. thank you
Sign In or Register to comment.