Read Only Access (error Trapping)

Kempes

Registered User.
Local time
Today, 09:11
Joined
Oct 7, 2004
Messages
327
I've searched the forum but can't find a solution to my problem.

I have many forms that have many controls attached.
I have also set up a group called READONLY, and assigned them permission only to open the forms and nothing else.

I have noted down the errors I want to trap so I can make a more User Friendly message to pop up. Ie, "You do not have the authority to run this command"

As there are many commands on various forms, I am having trouble finding the correct area to place some code along the lines of,

If err.number = 2603 then
msgbox "You do not have the authority.....etc"
end if

I don't want to repeat this code what could be 70/80 times.

I've attemped to place it in the "on Current" Event trigger to no avail.

I want the code to encompass the whole front end if possible.

Is this possible or am I going about this in the wrong way?

Any help would be great.

Thanks

Kempes
 
Create a function to handle all you errors. If there is an error pass it to the funciton. So if it's one of the errors you want to trap it will take it from there. If not, it will pass it back to the standard error handler that you build into the function.
Code:
On Error GoTo MyErrTrap

---Code here

Exit Sub
MyErrTrap:
Dim ErNum As Long
ErNum = Err.Number
	MyErrorHandler(ErNum)
Exit Sub

You then need to build the function MyErrorNandler
Which will take the ErNum Variable and do something with it.
A Select Case should do the trick.

Just a thought, let us know how you get on mate :)
 
have a read only version of the from, and a full version.

in your switchboard items table add an extra column for readonly forms, etc

in your switchboard form, test the usergroup and open the readonly form
 
Thanks for the replies.

I was looking at the "On Error" event for each form but can't get it to work.

I'll give it a try with a function.

Thanks
Kempes
 

Users who are viewing this thread

Back
Top Bottom