ToggleDesignViewMode()

F

Frank

Hi all,

I'm new to Access and Visual Basic. I've built the tables, queries, forms
and reports and I'm ready to write my first code (module?). I know I'm
basically asking someone else to write my code BUT... if anybody will "hold
my hand" here... I learn very quickly by example.

To get me moving quickly I need 3 procedures (or whatever they are called
in Access) AND I need to know "where" to locate them. I'm using a separate
message post for each request for procedure help.

"yisturday i didint no hou ta spel computir programar, taday i r wun".


THANX for your time... Frank


---------------------------------------------------
3 Computers (networked, peer-to-peer)
WindowsXP Pro SP3 (NOT using "simple" file sharing)
Access 2003 SP3
---------------------------------------------------

PROC #1 - ToggleDesignViewMode() ===========

1) Contain current "best practice" for error handling and debugging

2) Be ACCESSIBLE from anywhere within the Access environment... databases
AND (if possible) the VB Editor

3) IF the user just pressed the <Shift>+<Ctrl>+<F8> hotkey THEN

4) IF the current database object focus is "designable" THEN determine the
current object mode (design or view)

5) IF in VIEW mode THEN go into DESIGN mode AND SHOW ALL toolbars + the
property window + open the VB Editor (if it isn't already open)

6) IF in DESIGN mode THEN go into VIEW mode AND HIDE ALL toolbars + the
property window (menu bar + VB Editor stays visible)

7) ELSE MESSAGE("can't use that HotKey here")
 
T

Tony Toews [MVP]

Frank said:
3) IF the user just pressed the <Shift>+<Ctrl>+<F8> hotkey THEN

4) IF the current database object focus is "designable" THEN determine the
current object mode (design or view)

Why go to all this trouble? Give your users a front end MDE and they
can't get into the form objects. You as the developer who keeps the
MDB and makes changes to it.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
A

Albert D. Kallal

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. And, you DO NOT have to write code to do this.

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/AlbertKallal/msaccess/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/AlbertKallal/msaccess/msaccess.html

Of course, during development, you will hold down the shift key so your
startup settings don't run. You then develop for awhile, and then to test in
"user" mode, you exit..and then re-enter the application without the shift
key bypassed. You will likely do this dance all day long as you run/test as
user mode, and then flip back in to developer mode (shift key used..so you
don't get the main custom menu). So, you can't develop, or really modify
things when you run your application with the startup settings...so you must
shift-by-pass them when you want to work.

And, in fact, I use alt-f4 to exit the application...the mdb file should
still be highlighted in the windows explore..so, then you hit enter key
(and, hold down shift key if you need be). This key stroke sequence and
exiting and re-entering the application will occur CONSTANTLY all day long
when you are developing.

When you finally have things just right...you create the mde
you plan to distribute...

If you going to use a mde, it much a conclusion that you have to split your
database else you not be able to update your software you distributed. I
explain this here:

http://www.members.shaw.ca/AlbertKallal/Articles/split/index.htm
 
F

Frank

Hi Tony,

Thank you for the reply.
Why go to all this trouble?
<<
This HotKey is "for me". I like to layout all the tools when in DESIGN,
then, "clean up the workbench" when in VIEW.
Give your users a front end MDE and they can't get into the form objects.
You as the developer who keeps the MDB and makes changes to it.
<<
I agree. This was "one" message of a "three part" message post (I'm asking
for help on three different procs). Techniques I anticipate learning from
one of the other posts I would put into this post's ToggleDesignViewMode() so
that the <Shift>+<Ctrl>+<F8> HotKey was ultimately available ONLY to me.

I am "brand spanking new" to Access and VB. I'm moving 20 years of work
from Paradox/ObjectPal to Access/VB. I'm not a pro developer but have worked
with enough (brands) to know that each "brand" has it's own (code)
idiosyncrasies and construction style. I have a ton of code to write.


In general (accross the all three posts) I wanted to learn:
1) "Where" to locate code accesible by ALL areas of the application (to
avoid redundant code)
2) "When" code should really stay object specific (job specific and/or
idiosyncrasy)
3) Best practice error handling techniques
4) Determine what key the user pressed
5) "How to" communicate with the user (which includes me, the "d"velupper,
since I'm also new to Access/VB). Hence the emphasis on error handling in
addition to messaging.


ToggleDesignViewMode() - THIS POST specifically, I wanted to learn:
1) A liitle bit of the stuff listed in the "In general" section (see above)
2) Work with Access "window" objects (forms, reports, VB Editor, etc)
3) Get in/out design/view mode
4) Work with menus
5) Manipulate the VB Editor (if possible)


InsertRecordFromNetworkedPC() - ref my 2nd post specifically, I wanted to
learn how to:
1) A liitle bit of the stuff listed in the "In general" section (see above)
2) "Network" code considerations
3) Technique to avoiding using the AutoNumber property
4) Lock a recorded (if even needed)
5) Insert a record
6) Technique to "reuse" existing (qualified) record


DateTimeSignatureStamp() - ref my 3rd post specifically, I wanted to learn
how to:
1) A liitle bit of the stuff listed in the "In general" section (see above)
2) Determine who the user is
3) Work with memo/text fields (especially if it already contains formatted
text, always a PIA)


Phew!!!... boy-o-boy that word "why" is sure expensive. <grin>

Any "hand holding" is greatly appreciated.

THANX for your time... Frank
 
F

Frank

Hi Al,

Thank you for the reply.
Also, using these options means you do not have to bother setting up
security. And, you DO NOT have to write code to do this.
<<
YyyyseBaby! I'm for that!

If you going to use a mde, it much a conclusion that you have to split your
database else you not be able to update your software you distributed.
<<
Ooops! Now I'm lost. I'm too new to Access/VB to know what a mbe is yet.
The other thing is... I'm not a "pro" developer. All apps are strictly for
in-house use only.
http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
http://www.members.shaw.ca/AlbertKallal/Articles/split/index.htm
<<
Thank you for the pointers.


THANX for your time... Frank
 
T

Tony Toews [MVP]

Frank said:
3) Best practice error handling techniques

Download MZ Tools for the VBA IDE and use it's error routine insert
button. Saves lots of time. You need error handling in every VBA
routine.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top