Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Apr 2002
    Location
    Central Pennsylvania
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Rich Textbox in Access (Access 2002)

    I have a fairly urgent need to add Rich Text features to the text boxes in my application. I see a Microsoft Rich Textbox version 6 in my ActiveX Control list. I can insert one of these in my form but I have questions....

    I see it does not provide an OnChange event, but the text box I will be replacing needs an OnChange event.

    Even with it on the form, I don't know how to use it...what do you do to underline text, add a tab, make a word bold, etc.? Do I need to add a bunch of function keys? Somehow provide a font menu when they right click? Or maybe open a little control window when a user is in the rtf box? (something like the font controls on Word?)

    Finally, I was searching the Microsoft Knowledge Base for hints on where to find any kind of documentation, when I saw an issue saying that "Contents of Rich Textbox cannot be viewed in a report". It looks like a current issue that Microsoft acknowledges but won't fix. Apparently you can use a rich text box on a form but you can't print or preview it! In fact, the article refers a reader to FMS Inc to buy a rich text control that works! I can't believe that you buy a Microsoft product complete with all the bugs they can muster, then you are referred to another product instead of them fixing theirs! What a company this Microsoft is!

    Anyway...has anyone else used rich text functions in an Access app? Has anyone used the richtext control? Has anyone used the rich text control from FMS? How do you use the rich text control? Help, anyone?

    Thanks,
    Jerry

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Rich Textbox in Access (Access 2002)

    I don't know the FMS version. With the Microsoft version, you'll have to do all your formatting in code - IMHO, it's a pain in the <img src=/w3timages/censored.gif alt=censored border=0>; I've never found it worth the hassle.

    Note: the Microsoft Rich Textbox control does have an OnChange event. Open the module behind the form, select the Richt Textbox from the dropdown list in the upper left corner of the module window, then select Change from the dropdown list in the upper right corner.

  3. #3
    New Lounger
    Join Date
    Apr 2002
    Location
    Central Pennsylvania
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Rich Textbox in Access (Access 2002)

    Hans,

    Thanks for the info. By doing the formatting in code, do you mean that I need to be watching each keydown event (assuming there is one...) and then formatting based on a user entry...ie. user enters Ctrl-B (or something...) and I interprte that to mean they want to insert a bullet point, or CTrl-H and I set the Highlight on any selected text? As an alternative, maybe supply a menu somehow on the right mouse button and allow then to choose formatting rules from there? I'm a complete novice on this one...

    Thanks,
    Jerry

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Rich Textbox in Access (Access 2002)

    Hi Jerry,

    (1) The Rich Textbox control has all the standard events; you can see the list using the method I described in my previous reply. So you could write an event handler for the KeyDown event, but it would be a lot of work - you'd be writing your own version of Word. For example: suppose the user types Ctrl+U; this usually means underline in word processors. You'd have to check whether the selection is the insertion point (the blinking vertical bar) or a range of characters. In the first case, you would have to determine whether the text immediately preceding the insertion point is underlined, and act accordingly. In the second case, you would have to examine the selected range to see whether it was completely underlined, partly underlined or not underlined at all, and act accordingly. Etc. etc.
    (2) A context menu or toolbar is probably easier - the user selects a range and clicks the Underline option/button. But you'd still be emulating a word processor.

    As I mentioned in my previous reply, I have never found it worthwile to work out all the details, so I can't give you detailed instructions. I would investigate whether formatted text is really necessary. If so, perhaps you could provide hyperlinks to Word documents.

  5. #5
    New Lounger
    Join Date
    Apr 2002
    Location
    Central Pennsylvania
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Rich Textbox in Access (Access 2002)

    Hans,

    Thanks for the info. Yes, that's where I was thinking this went. I don't mind spending the time to build the things I need, this is something that will add a lot of usability to the application I've built. Since MS says Access can't preview or print rtf contents, I suspect my efforts will be wasted. I suppose I have to consider buying a usable rtf control from FMS or other vendor. What a sham MS "support" is!

    Jerry

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    352
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Rich Textbox in Access (Access 2002)

    Just an Idea. Would it be easier to build code to open a new document in word, allow the user to edit it, and then copy it into the RTF Control. (or have an embedded word document instead of the RTF control)?
    David Grugeon
    Brisbane Australia

  7. #7
    New Lounger
    Join Date
    Apr 2002
    Location
    Central Pennsylvania
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Rich Textbox in Access (Access 2002)

    I thought breifly about embedding Word documents but dismissed the idea because of the probable volume. I'm sure (Murphy's Law) that somewhere down the road I would have compatibility issues too, since I don't control what versions of Office might be installed. What I hadn't thought of was your idea of copying a Word document into an rtf control...hmmm...maybe a transparent way to open a small Word window, let them enter their stuff, copy that back into my app...that one is definitely worth looking at.

    Thanks,
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •