Cron <cr*******@hotm ail.comwrote:
>Right, I'll have a
look around tomorrow and see if can find some VBA to allow trusted
locations.
All trusted locations are stored in the registry under:
HKCU\Software\M icrosoft\Office \12.0\Access\Se curity\Trusted
Locations\Locat ionN
(where N is an integer)
To see what the entries should look like, just add a trusted location through the
Trust Center, then go to the registry to look at the key and see what it did. Note:
you cannot trust a specific file, but only at the folder level, so you'll want to
make sure that you're installing your app to a folder that contains only your
application and not other stuff.
You can add any key name you want unde Trusted Locations\ instead of using LocationN.
Such as Trusted Locations\My App or Trusted Locations\<gene rated GUID>
So what you could do is have a startup form with a big text comment telling the user
to click on Security prompt at the top of the Access window. Now the first thing
your VBA does is set the above Trusted Locations registry key, if not already there
and close the form and continue. If the VBA code is working because the Trusted
Locations key is set then this form is visible for a flicker.
You will need to use an API call to set the registry location. See vbnet.mvps.org.
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -
http://msmvps.com/blogs/access/