Connecting Tech Pros Worldwide Help | Site Map

Disabling Design View of a Form

  #1  
Old November 13th, 2005, 09:58 AM
keni
Guest
 
Posts: 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 -

  #2  
Old November 13th, 2005, 09:59 AM
Jan Jørgensen
Guest
 
Posts: n/a

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


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't use the GoToRecord Action in Design View Tim Hunter answers 1 December 5th, 2006 01:55 AM
Disabling hotkeys again... Matthew Wells answers 3 November 13th, 2005 04:28 AM
Disabling hotkeys Matthew Wells answers 1 November 13th, 2005 04:26 AM
Form Record Navigation fred14214 answers 3 November 12th, 2005 06:59 PM