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!

Disable Design View Using VBA

Status
Not open for further replies.
Jun 2, 2004
66
0
0
US
I have discovered that you can disable many of the views in the properties section of the form, but I cannot find a way to disable the design view. Basically, I am looking for a way to disable the design view option when a user right clicks on a form.
I understand that I can disable the "right click feature", but I do not want to do that because of the copy/paste function that my users would like.
Is there a way to put a code in the OnActivate function of the form so that it will recognize the login and only allow the designated user to have the design view feature active on right click?

Maybe something like this....??

Private Sub Form_Load()
If fOSUserName() = "myname" Then
CODE HERE
Else
CODE HERE
End If
End Sub


I am aware that there is a post that claims to address this issue, (Disable Design view through VB coding
faq181-1172)but have tried it and have been unsuccessful. Anyway, I looked at the code and honestly could not find anything that relates to disabling the design view.

Thanks
 
Have you tried to play with the AllowDesignChanges property of the form ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes. I have changed AllowDesignChanges in the properties section from "All Views" to "Design View Only" This still doesn't help me because the user can still right click on the form and choose Form Design from the list.

Is there a way I could incorporate something into code? There were a few things online about....

Me.AllowDesignChanges = False

but would this solve my problem? I tried putting this on the form's On OnLoad Event but I got an error. Do you know what I can do to get this to work.

Remember, I need the "right-click" option to remain active because the users will want to use the copy and paste features.
 
In addition to disabling the Form Design option when the form is "right clicked" I also need the Properties option to be disabled when the form is right clicked.

Is there a way to do this?
 
ineedyourhelp,

How did creating a custom shortcut menu help? I have the same exact problem you did. Please explain what you did to solve your problem.

Thanks in advance!
David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top