you need to trust the location of the db to enable macro's
if this is a 'first time install' you can do it by modifying the registry rather than doing it through access - assuming the user has the appropriate rights to do so.
Not enough information provided to say how you might do this, it may be the batch file can do it or you need to use an installer app. And depends on the setup - remote desktop connecting to terminal server? citrix? something else? Using .accdb? ,.accde? .accdr? user has runtime or full access on the remote server? each user has their own profile, etc etc
I used to do it via settings but then reverted to VBA
I actually can not remember what is the impact of the setting when the user uses Runtime
I do know that you do not have any setting option when using runtime only
Using VBA just made more sense but now I have the enable macro first issue so anyone can access the table when the DB opns
Not sure where to add my specific location though as per the first part of my batch file
I do still get a security notice popup as per below screenshot
@ECHO OFF
md %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP
del %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
copy "\\sjo2054\CAMO\DAW Sheet\Engineers\Daw Sheet.accdb" %USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\DawSheet.accdb
set dbpath=%USERPROFILE%\AppData\Local\Temp\Eng_DAW_Sheet\EngDAWSHEETTEMP\
set Description=Daw Sheet
set TrustedKey=HKEY_CURRENT_USER\Software\Microsoft\Office16\Access\Security\Trusted Locations
You have to open Access on the PC where the app will run and go to the OPtions. You can set the trusted locations there. You have to check the box to allow trusted locations on the server and the other to trust the subfolders also.
The other option is to add keys to the registry. I can't look for them now but if you search you will find the keys you need. you will have to change the paths.
You have to open Access on the PC where the app will run and go to the OPtions. You can set the trusted locations there. You have to check the box to allow trusted locations on the server and the other to trust the subfolders also.
The other option is to add keys to the registry. I can't look for them now but if you search you will find the keys you need. you will have to change the paths.
I need to do this via a batch file but not sure on how to se a trusted location
We have 15 PC's in the hanger locally and a few remotely, I can not set them all manually
As mentioned, the remote computers run access runtime, it does not allow for any option settings
It has to be code either via a batch file or VBA
The batch file copies a new front end every time the run the batch file so i need to test for trusted location every time the open the DB
For the individual locations, you need to supply a unique name. Above you see Location0, Location1, Location2. Doesn't matter what the name is but it must be unique.
Type RegEdit in the search box for windows. It will open the registry. Drill down using the path structure above. 17.0 is my version of office. Yours might be different so change it as necesary. If you have multiple versions in the list, add the keys to the newest version.
To prevent having to constantly add new folders to trust, create a folder pretty high up in the hierarchy and trust it as well as its subfolders and always put your access databases somewhere in that hierarchy. So you need a minimum of three keys
1. to trust folders on the network
2. to trust a high level folder on your C:\ drive
3. to trust a high level folder on your server drive - you could use a mapped drive letter but I prefer to use UNC name for this.
If you name the text file with .rga as the extension, Windows will know it is a registry update and will run the update if you double click it. Sooooooooo be careful to not double click if you want to open it but not run it. Right click and choose Edit.
Your Network Administrator can (and should) do this for you. He can distribute to all the user computers. You just have to give him the keys you need to add.
Instead of requiring VBA to hide your stuff, set it up to require VBA to continue into the DB. What you do is create a modal popup form that says you must enable scripts/content or whatever and set that as the form to load on startup in the settings. Also in settings, you turn off the navigation pane.
In the form's load event, you put code to close it and open the form you really want users to interact with.
When folks load the app, they get that form and nothing else until they allow scripts. Once scripts are allowed, the form goes away and they get the form they need. If they previously marked the file as trusted then scripts run as soon as it's opened meaning that form flashes quickly (usually too fast to even be noticed) and the proper form shows right away.
Alternatively, most of what I've released is in ACCDE format which cannot be open at all until the scripts are enabled, so this is rarely a problem.
And I just realized that the ACCDE approach is basically the same as the form approach but more solid and with Access doing the hard work for you.