Remove Restore Button

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Hi there everybody,

First of all, thank you all, especially the MVPs! I'm pretty new to
access with no formal programming training, but have very gratefully
lurked and used these newsgroups over the past few months to teach
myself access.

I'm coming to the end of my project now and am trying to remove the
maximise, minimize and restore buttons from the top-right hand corner
of all my forms. From what I can gather, the only way to do this on
Access 2000 is to use Terry Kreft's code in the API's section on the
mighty MVPs' website (http://www.mvps.org/access/api/api0022.htm).

My problem is that I haven't used a module before and have no idea how
to get it to work in my forms. I have created a new module with TK's
code in but could use some help in exactly what to put in the code
builder to get the Form's open event to execute the code / module. (I
don't know if it matters, but the Open event already has this line in
it to maximise Access on opening - DoCmd.RunCommand acCmdAppMaximize.)

Thanks in advance for your help, and to Terry for the code.
Cheers
Tim
 
I'm not sure if that code still works in Access 2000, so you will have
to see.

Put all that code in a standard module (ie. a module not connected to
any particular form), /or/ in the form's code module. It should work in
either place.

Then just replace the line in your form:
DoCmd.RunCommand acCmdAppMaximize

with the new line:
MaximizeRestoredForm Me

Post back & say if it works.

HTH
TC (MVP Access)
http://tc2.atspace.com
(off tomorrow)
 
Thanks very much for walking me through it TC. I still had a little
trouble at first but I was being a bit of a dumbass!

I realised that my main problem was that I had two lines of code -
1. to maximise the Access application and
2. to maximise the form.

Therefore when I replaced the max-application code the max-form code
was still there. That meant that after TK's code the form would
maximise again! (thus making the restore button reappear.) Needless to
say, I chopped both commands out and replaced it with TK's which worked
flawlessly.

Thanks very much for your time TC.
Cheers
Tim
 
Back
Top