Re: Disabling Design View of a Form
"keni" <zken@tongaken.org> skrev i en meddelelse
news:1113598470.400974.301690@f14g2000cwb.googlegr oups.com...[color=blue]
> 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 -
>[/color]
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 |