Split Database, Macro to Open Form, Stop Error Message (1 Viewer)

chriscook

Registered User.
Local time
Today, 04:12
Joined
Nov 24, 2014
Messages
30
Hello All,



Apologies if this has been dealt with in other posts but I could not find any information on this.



Our company has been using a database for a number of years, but I am in the process of updating the security of all the databases.



I have split the database, put the Back end (password protected) into a hidden share on our Server. I have then granted read/write access to those who need it.



Everything works fine using this. When i give the front end to all the relevant users, all works well. Note: when the database is opened, it is set up to open the "Home" Form.



However, if this user gives a copy of the front end to another user who doesn't have access. The first message that appears when they open it is:


The Microsoft Access database engine cannot open or write to the file '\\ FILE LOCATION. :banghead:



I am looking for a way to stop this error message appearing, as it gives the location of the back end.



I appreciate your help with the above, and apologize if it has been answered elsewhere.
 

Ranman256

Well-known member
Local time
Yesterday, 23:12
Joined
Apr 9, 2015
Messages
4,339
give the user access rights BEFORE you give them the app.
no error.

the autoexec macro that opens the main menu (no tables) should check the status of a table beforehand.
runcode CheckTblStat()
openform frmMain

the CheckTblStat() can trap the error:
Code:
function CheckTblStat()
on error goto ErrTrap
dim rst

set rst = currentdb.openrecordset("select * from table")
exit function
ErrTrap:
msgbox "No access to db tables"
docmd.quit
end function
 
Last edited:

chriscook

Registered User.
Local time
Today, 04:12
Joined
Nov 24, 2014
Messages
30
Sorry, I don't think I have explained myself correctly.



My problem is if a front end is copied to another user who doesn't have access to the back end (who we do not want to give access to). When they load the front end, it will give the location of the Back end file.



I want to hide the back end location from all users.
 

Ranman256

Well-known member
Local time
Yesterday, 23:12
Joined
Apr 9, 2015
Messages
4,339
then WHY does he have the app if he cant use it?

1 not give him the app
2. in the db you can hide all the tables so they cant see them
3. put in the macro i mentioned to not give the error.
 

chriscook

Registered User.
Local time
Today, 04:12
Joined
Nov 24, 2014
Messages
30
The likelihood is that he won't have the front end. But, if a user who has the front end passes it onto them, they will then know the location of the back end (and could pass this onto users who have access, but do not know the location)


My apologies, I did not see the code you have provided (viewing on my phone)


I will try this code.



Thanks again for your help.
 

chriscook

Registered User.
Local time
Today, 04:12
Joined
Nov 24, 2014
Messages
30
Your code worked brilliantly.



Thank you very much for your help!
 

Users who are viewing this thread

Top Bottom