Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Security Question

Status
Not open for further replies.

Garridon

Programmer
Mar 2, 2000
718
US
I have Microsoft Security set up on my database, using groups and permissions. I trapped the error that pops up if you click on a button to a report or form that you don't have permission to access:

If Err = 2603 Then

MsgBox "You do not have access to this department's suspenses"

But, I also have a menu bar with the reports on it. When you click on a report from the menu bar, it pops up with the Access permissions error. Is there are way to use my error handling when the menu bar is accessed? Linda Adams
Visit my web site for writing and Microsoft Word tips: Official web site for actor David Hedison:
 
Sure! Just change the menu item's Action parameter to the name of a custom-written function that opens the form or report, and contains your error trapping code.

Although the documentation says that to call a user-written function from a menu item you should use the syntax "=MyFunction()", don't do this. At least in Access 97, there is a bug that sometimes causes this to fail with a message saying Access can't find the function.

Microsoft's workaround is to code just the function name, "MyFunction", with no "=" or parentheses. This seems to work ok for me. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top