4

I am getting an issue with a access 2007 application that I am working on. Access acts as a front end for a SQL server 2005 backend. When I try to click on a richtext control on the form, it gives me the following error:

Because of your security settings and current security policy, this control is disabled. To modify your policy and enable the database, use the message bar.

After a bit of searching, the suggestiong is to add a trusted location, however this error still comes up.

peterh
  • 11,875
  • 18
  • 85
  • 108
skub
  • 2,266
  • 23
  • 33
  • Do you have other code that runs without any problems? – HK1 Mar 29 '12 at 01:10
  • What version of Windows are you using? You might check out this blog entry: http://chrispauly.blogspot.com/2009/02/access-2007-error-using-mshflxgdocx.html – HK1 Mar 29 '12 at 01:28
  • Yes, other code is fine, it only happens in that rich text box. I am running vista. Many thanks. – skub Mar 29 '12 at 03:02

2 Answers2

1

Ok so I found out the cause of this issue after a lot of trial and error. It seems that the rich text box control has limited support in Access 2007. I found out that the rich text box I am using is Microsoft Microsoft Rich Textbox Control 6.0 (SP4) - RichTX32.OCX. Apparently it will cause the above error if activeX is disabled.

To fix this I modified my registry entries as follows (although this opens up security issues with IE aswell):

  1. Open up regedit

  2. Go to the following key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ActiveX Compatibility{3B7C8860- D78F-101B-B9B5-04021C009402}

  3. There should be a DWORD called Compatiblity Flags. Set this to 0 (default is hexadecimal 400)

Some additional information that I found useful follows:

Community
  • 1
  • 1
skub
  • 2,266
  • 23
  • 33
  • 1
    And that's just another reason for not using external ActiveX objects at all. Access 2007/2010 comes with a rich(er) text box that allows some formatting. By sticking to incorporate ActiveX objects into your application, you will suffer death by a thousand cuts: firs tit won;t always work on your machine, then it won't work properly on the other machines you're installing this too, and you risk ending-up having to spend a lot of time fixing problems that are configuration/installation issues. There is a good reason most professional Access devs don't use ActiveX... – Renaud Bompuis Mar 29 '12 at 05:49
  • Yeah - I hear you :) The problem was that this application was developed many years ago by developers who already left. Although it does not look like it is going to be upgraded/replaced any time soon in the future... – skub Mar 29 '12 at 10:25
0

I recently found this ?, and started updating the control to work. Then, I came across the right way to get rich text in a form in MSO 2007+:

Insert or add a rich text field

It says you need to have a memo field in a table, and set its text format to Rich Text. Since the solution is a bit opaque, I'll continue with what worked for me: I then go into form design, and create a text field. I set its data source to the table's rich text memo field; and its "Text Format" property to "Rich Text". I set its "Scroll Bars" property to "Vertical".

Now, I get some nice text formatting options in Access 2010; but it's kinda stupid the way they've implemented them. There's no format painter. Also, if I want to e.g. set the font to Times New Roman to pitch 11, it doesn't let me; but makes turns it into 10; although I can select 12 also - but not 11. If, however, in Design View, I set it the field's font to "Times New Roman", and set the font size THERE to 11, the font is size 11 by default. I can paste things into it in 11 pitch, by first pasting them into Notepad, to strip them of their formatting attributes, and then from Notepad into my field, to get pitch 11 text; or I can paste pitch 11 from elsewhere.

This has the advantage of getting some handy text formatting controls to light up on your home ribbon, and lets you format stuff more or less properly.

CodeLurker
  • 1,248
  • 13
  • 22