By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,704 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,704 IT Pros & Developers. It's quick & easy.

Disabling Design View of a Form

P: n/a
One method of disabling Design View is to create an MDE database.
Without going into details, this won't work in my situation. What I
need is just a snippet of VBA code that will disable the design view of
my Employees form so the data entry people cannot enter design view and
modify it. I know very little about VBA, but surely there must be some
simple code like:

Sub
Designview.form = 0
End sub

or something along these lines that will accomplish the task?
- Keni -

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"keni" <zk**@tongaken.org> skrev i en meddelelse
news:11**********************@f14g2000cwb.googlegr oups.com...
One method of disabling Design View is to create an MDE database.
Without going into details, this won't work in my situation. What I
need is just a snippet of VBA code that will disable the design view of
my Employees form so the data entry people cannot enter design view and
modify it. I know very little about VBA, but surely there must be some
simple code like:

Sub
Designview.form = 0
End sub

or something along these lines that will accomplish the task?
- Keni -


I have a yes/no field that can be toggled from the administorscreen.
In the administratorscreen there are instructions that after toggling, the
database need to be re-started.

In the table "Parametre", the yes/no field is called "Show_menus".

Now cut and paste the following into your database :

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
allow= DLookup("[Show_menus]", "parametre")
If allow <> -1 Then
'ChangeProperty "StartupForm", , "Startform"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, False
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, False
ChangeProperty "AllowBypassKey", DB_Boolean, False
Else
'ChangeProperty "StartupForm", , "Startform"
ChangeProperty "StartupShowDBWindow", DB_Boolean, True
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
End If

End Sub
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.