Admin rights using VBA?

msalem

Registered User.
Local time
Today, 06:01
Joined
Feb 7, 2008
Messages
24
Not sure if this is possible....

My Access front db users have restricted rights and while executing a VBA module (which requires deleting a table in the back db) , an error is thrown up saying it requires administrator privileges to run.

The module works fine when I log on through the Admin account.

Would it be possible to give users with restricted rights Admin privileges only for executing that module i.e. can the rights of a user with login ID say "User1" changed within the VBA module for full access and back to User1 at the end?

Thanks for any help
 
I would be tempted to remove the function from admin rights and prompt the user for a password to run the procedure. This way you can define which users can and cannot run this delete.

David
 
How could this be done? Could you please elaborate a bit more.

The module is invoked from the print command button on a form?

How can I prompt for a password and assign which users can run the delete?

Thanks
 
In its simplest terms:

Create a new form that has one textbox on with the input mask set to Password.

Add an Ok button

Write some logic behind the button click to test for a valid password (You decide what)

If correct
do the biz
else
do nothing
end if

close the form
 
The things is user groups have been assigned to the database as all users are not permitted to have complete access. So if an end user who doesn't have all privileges (as he logs on with his account) wants to run this routine which requires administrator privileges, how can he run the routine?

My thoughts behind this were to find a way if he could inherit the admin rights when he runs that routine only?
 

Users who are viewing this thread

Back
Top Bottom