Views allowed

Ashley Sutton

Registered User.
Local time
Today, 12:43
Joined
Jan 25, 2000
Messages
10
Using the code 'Me.ViewsAllowed = 0' (or 1 or 2)produces the error 'You can't assign a value to this object'.

Any suggestion of what I am doing wrong?
 
Having tried this myself just now it looks like its one of those "non-dynamic" VBA things - you set it once and live with it, you don't change it for each user. If you want to restrict user access you may have to play with the menu bars and change the "Shortcut Menu" in the other tab of form properties to No or create your own. Appreciate that isn't much help but HTH anyway

Drew
 
I've been having this same problem (a year later though). Can anyone help out now? All I could find so far tells me that it can't be changed with code because its relationship with the defaultviews property. Changing both of them doesn't seem to work either. Thanks.
 
Revisiting this after a year I find it is possible although as KDg indicated it appears that you can only set this property in form design view. I found that opening the required form in hidden,design view, setting the viewsallowed value and then switching the form to normal view achieved the result. However when closing the form you are prompted to save changes. Since it is unlikely that permanent changes are required you would have to code your way around this. I needed to be able to switch the views allowed once the form was open so found myself getting ever more bogged down in this by switching views to design, making the change, switching back and then having to deal with the various 'on load' events being retriggered which was not wanted at this time. All in all it seemed to be getting 'out of hand! However by starting the design of your form from scratch it may be possible to achieve something workable.
 

Users who are viewing this thread

Back
Top Bottom