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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling the design view option

Status
Not open for further replies.

eussias

Programmer
Sep 25, 2001
97
0
0
AU
I have built a custon login page which allows different users to login using their own password. This information is held in a table called UserList, which comprises UserNames, Passwords and AccessRights. What I want to do now, is if a user logs in who only has read-only rights, I do not want the design view of the form present on the toolbar... ie.. they cannot change the design of anything. I've been playing around with the docmd.showtoolbar option, but was wondering if this is the best way to do this??
 
eussais,
The best way is to implement security, which it sounds like you have. If the user has readonly rights to the form, then he won't be able to go into design view. The menu option/icon for design can still be there, if only as a tease to would-be hackers. If it's an esthetic issue and you want to remove it, then you need to create your custom toolbars.
--Jim
 
Hi!

I don't know if this is the best way or not, but it is a possibility. Add a form level boolean variable and add this code:

In Form_Load:

If AccessRights = ReadOnly Then
bolNoDesign = False
Else
bolNoDesign = True
End If

In Form_UnLoad:

If bolNoDesign = False Then
Call MsgBox("You must exit using the Return to Main Menu button")
Cancel = -1
End If

Then, if your form doesn't already have it, add a button to recall the menu form and add code in it's click event to set bolNoDesign to true.

hth Jeff Bridgham
bridgham@purdue.edu
 
Thanks for the advice guys... I should have explained a little clearer before... I'm not using the built in security features of Access. I'm doing this more of a learning experience than anything else. The read-only rights etc, are stored in a table UserList along with UserNames and Passwords. When my database is opened, a Login form is opened, prompting for UserName and Password. What I then want to do is, if the associated UserName that is entered has read-only rights (taken from UserList), then I don't want those users to be able to alter the design of the forms at all. Is there any easy way of doing this?
 
Hi Again!

You can still use my method assuming you have stored the users AccessRights somewhere when they logged in. You just check the rights you have stored and set the form level variable. Make sure that you have a way to return to a switchboard or a menu form and only allow them out of the form by taking that option. If you need more information let me know.

hth Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top