473,426 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,426 software developers and data experts.

Prevent Design View

I'd like to prevent users from accidently going into design view of a form
and screwing it up.
I've googled the group and have found that the normal method is to use MDE
or user level security. I'd like to avoid both of those options as I'm only
trying to stop accidental changes, not willful misconduct. These mdb's are
too quick/simple to over program.

Now, I have found that the following code works, but I'd like to get your
opinions.

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
DoCmd.Close
On Error GoTo 0
End Sub

I understand that if the user gets the database window, they can open the
form in design view. That's fine, I'll can live with that. I just want code
such that if they are changing from datasheet view to form view or back; and
they accidently click on the "green triangle", the form will just close
instead of opening in design view.

Any forseeable problems with this?
TIA
Fred Zuckerman

Dec 3 '05 #1
8 8697
> I'd like to prevent users from accidently going into design view of a form
and screwing it up.


What's wrong with the mde option?? IMO It is perfect for the option you need
It is build in. It works all right.
They just *can't* screw up your design, neither accidently nor on purpose.

Arno R

Dec 3 '05 #2
"Arno R" <ar***********@tiscali.nl> wrote in message
news:43**********************@text.nova.planet.nl. ..
I'd like to prevent users from accidently going into design view of a form
and screwing it up.


What's wrong with the mde option?? IMO It is perfect for the option you need
It is build in. It works all right.
They just *can't* screw up your design, neither accidently nor on purpose.
Arno R

You're correct, except that it requires that the mdb be kept around
someplace. I only visit this client occasionaly. Plus they DO have 1-2
people that "could" make design changes. Primarily, though, their normal
users don't have a clue. So, if there were an mdb, then I'd probably need to
keep it (or they might lose it) and then I'd be "tied" to their operation.
Fred
Dec 3 '05 #3
As mentioned, the mde is the way to go (however, this does assume you have a
split database...you REALLY need to do that for any kind of software
updates).

Another approach is to simply hide the ms-access interface via
tools->startup....

You most certainly can, and should hide all of the ms-access interface. The
options to complete hide and keep people out of the ms-access interface can
easily be done using the tools->start-up options. Using those options allows
you to complete hide the ms-access interface (tool bars, database window
etc). Also, using these options means you
do not have to bother setting up security.

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKal...s/DownLoad.htm

After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options. If
want, you can even disable the shift key by pass. I have a sample mdb file
that will let you "set" the shift key bypass on any application you want.
You can get this at:
http://www.members.shaw.ca/AlbertKal.../msaccess.html

In the tools->startup..if you disable shortcut menus..then no "design" will
be allowed....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Dec 3 '05 #4
Fred Zuckerman wrote in message
<x5*******************@newssvr14.news.prodigy.co m> :
I'd like to prevent users from accidently going into design view of a form
and screwing it up.
I've googled the group and have found that the normal method is to use MDE
or user level security. I'd like to avoid both of those options as I'm only
trying to stop accidental changes, not willful misconduct. These mdb's are
too quick/simple to over program.

Now, I have found that the following code works, but I'd like to get your
opinions.

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
DoCmd.Close
On Error GoTo 0
End Sub

I understand that if the user gets the database window, they can open the
form in design view. That's fine, I'll can live with that. I just want code
such that if they are changing from datasheet view to form view or back; and
they accidently click on the "green triangle", the form will just close
instead of opening in design view.

Any forseeable problems with this?
TIA
Fred Zuckerman


I agree about using mde, but to offer some comments on your approach

I don't know if I can give any good explanations of why, but I don't
like using
docmd.close within a routine where it's alredy closing, don't ask me
why, I
can't give any good reasons - just preference? ;-)

I would suggest qualifying the close, should you use it, i e

DoCmd.Close acForm, me.name

In stead of the above, I'd considered expanding this a bit, using the
approach of having your own close button, in which you toggle a boolean
variable with form class module scope, which will then be assigned the
cancel parameter in the unload event.

See
http://www.mvps.org/access/general/gen0005.htm
for some more info

--
Roy-Vidar

Dec 4 '05 #5
I agree that splitting the DB to FE/BE is the way to go.

But there're few occasions that I would prefer to keep data and program
in one file, mainly for simplicity. And I heard that MDE is less stable
than MDB for data. Is this true?

Eddy S.

Dec 5 '05 #6
"Fred Zuckerman" <Zu********@sbcglobal.net> wrote
I'd like to prevent users from accidently going into design view of a
form
and screwing it up.
What's wrong with the mde option?? IMO It is perfect for the option you
need
It is build in. It works all right.
They just *can't* screw up your design, neither accidently nor on
purpose.
Arno R

You're correct, except that it requires that the mdb be kept around
someplace. I only visit this client occasionaly. Plus they DO have 1-2
people that "could" make design changes. Primarily, though, their normal
users don't have a clue. So, if there were an mdb, then I'd probably need
to
keep it (or they might lose it) and then I'd be "tied" to their operation.


If you don't keep a separate development copy of the MDB, anyway, you are
taking a serious risk of disrupting your client's business in case of an
error (which might be totally beyond your control).

Don't ask me what the legal ramifications might be -- I am not a lawyer; I
am talking about business risk, not legal risk, here.

Larry Linson
Microsoft Access MVP
Dec 5 '05 #7
"Eddy S." <ed*****@yahoo.com> wrote
I agree that splitting the DB to FE/BE is the way to go.

But there're few occasions that I would prefer to keep data and program
in one file, mainly for simplicity. And I heard that MDE is less stable
than MDB for data. Is this true?


I'm not at all sure what "MDE is less stable than MDB for data" even
_means_.

Making an MDE prevents going into design view on Forms, Reports, and
Modules. It does not "protect" anything else -- only those objects which
are, or have, Modules. AFAIK, it should have no effect on Tables,
Relationships, Queries, or Macros.

Larry Linson
Microsoft Access MVP
Dec 5 '05 #8
Larry Linson wrote:
I'm not at all sure what "MDE is less stable than MDB for data" even
_means_.


What I mean is that I've come across comment/post that when data is
stored in the MDE format the chance of DB corruption is somewhat higher
that storing the data in MDB format.

But I can't be certain that the comment/post is correct... So I was
hoping that some one who's more familiar with the subject could
confirm.

Eddy S.

Dec 5 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: P. Emigh | last post by:
By default in more recent versions, Access forms keep users' last sort request in the "orderby" property. That can slow things down considerably, especially when the last user has chosen a...
13
by: Tony Williams | last post by:
I have a query that I want to count the number of records where the value of a field "txtFactClients" is not 0. I have set up an expression "CountFC: txtFactClients" with Count selected in the...
9
by: Larry Woods | last post by:
I have a method in my base class that I want ALL derived classes to use. But, I find that I can create a "Shadow" method in my derived class that "overrides" the method in my base class. Can't...
1
by: Sagaert Johan | last post by:
Hi I made a control that in its onload sets the dockstyle to Fill, I only want this in runmode not in the IDE forms designer. Is there some attribute or define i can rely or use to prevent...
4
by: Fred Flintstone | last post by:
This is THE most annoying feature of VB.Net I've ever seen. *I'LL* decide what my controls will do and look like, thanks. I have an overridden panel control with a gradient background and 3D...
1
by: Nogusta123 | last post by:
Hi, I have had a lot of problems getting web pages, master pages and content pages to render in VS2005 design view the same as they would in Internet Explorer. I did a lot of looking on the...
1
by: RICHARD BROMBERG | last post by:
I am writing an Access program using Access 2000. There may be a small market for the application aI am writing and I would like to do two things. First I'd like to prevent a user from going...
3
by: ncsthbell | last post by:
In startup options, I have unchecked "Allow Full Menus", so users cannot select 'Hide/unhide' from the toolbar menus. On this same form I also have "Display Database Window' unchecked. On...
2
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.