Link to home
Start Free TrialLog in
Avatar of SDS_Dev
SDS_Dev

asked on

Open AutoCorrect Options Dialog using VBA/Code In Runtime Mode

My agency is converting from MS Access 2003 to 2010.  The 2003 version of my application has a menu option which allows the user to open the built-in AutoCorrect Options dialog box.   Now I want to give the user the same functionality from the ribbon.

I found a post on another website which asked the same question about opening AutoCorrect Options - but for use in Excel.  The answer was to use the following line of code:
Application.Dialogs(xlDialogAutoCorrect).Show

Unfortunately, this code does not work in Access--in either 2003 or 2010.  The Application object in MS Access does not seem to have a "Dialogs" property.

I also could not find an idMSO for opening the dialog box.

The AutoCorrect Options dialog can be found in Access 2010 in the Options window in the backstage view.  However, I could not get the built-in Access 2010 backstage "Options" window to appear when in runtime mode.  An Options window appears, but it only has three useless links--none of which has anything to do with the AutoCorrect Options dialog.

How do I write code to let the users open the AutoCorrect Options dialog in runtime mode?  Because AutoCorrect is on by default, and because autocorrect seriously harms our data, my users need to be able to manage the options in AutoCorrect.  

Please Help!  Thanks!!
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SDS_Dev
SDS_Dev

ASKER

Peter:  That's it!  Doh!  I should have thought of that.  Thanks so much!!!

On a follow up note:  I marked your answer as the solution when I got your code to open the AutoCorrect Options dialog.  Then I realize: uh oh, I still need to try it in runtime mode.  So, I changed the file to .accdr and tried to open the file.  The file corrupted on open and the repair did not work.  So, then I went back to a version of the file that I started with this morning - just so I could test your code.  And it corrupted again as soon as I tried opening the file in runtime mode.

I don't know what is going on.  I've had lots and lots of corruption problems since I started trying to upgrade to Access 2010.  (Yes, I did all those things like importing all the objects to a new file, etc.)  

Bottom line, I can't say for sure that this solution worked until I figure out my corruption problem.  But it seems like it should work.  

Thanks again for the idea.
Avatar of SDS_Dev

ASKER

More follow up:
   I have been able to get Peter's line of code to work in the runtime environment.

ON a related topic: I hoped that I would be able to use the same idea for the other need: showing the "trust center" so that users can get rid of annoying "security" messages.  However, the following line of code seems to cause problems:
docmd.RunCommand acCmdOptions

It is possible that I'm still experiencing corruption problems.  It is also possible that MS does not allow us to display the Trust Center to users?  If anyone knows the answer to that... Or maybe I should post that as a separate question?  Today is my first day using Experts Exchange.

Thanks again.