Results 1 to 11 of 11
  1. #1
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remove restore button (Access 2000)

    I've tried making use of the API (http://www.mvps.org/access/api/api0022.htm) call listed in a previous topic on this subject. But never having made an API call before, I'm pretty much in the dark on where the code belongs. I did have a go, & put the code in the "oncurrent" bit, but part of it appears to be unrecognised;

    Public Const SW_MAXIMIZE = 3
    Public Const SW_SHOWNORMAL = 1

    All help welcome [img]/forums/images/smilies/smile.gif[/img]

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remove restore button (Access 2000)

    The code block from API: Remove Close button from maximized forms (the text with a pale blue background) should be copied as a whole into a standard module (a module in the Modules section of the database).

    Call the MaximizeRestored procedure in the OnLoad event of the form:

    Private Sub Form_Load()
    MaximizeRestoredForm Me
    End Sub

    Note: you can make a link "live" by placing <!t><!/t> before it, and <!t><!/t> after it; you can also insert these tags using the 1-Click TagPanel.

  3. The Following User Says Thank You to HansV For This Useful Post:

    ppdung.public (2014-03-15)

  4. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove restore button (Access 2000)

    I have used Calvin's tip #19 successfully with some help from my cyberfriends!!
    See attached sample.
    Michael
    Attached Files Attached Files

  5. #4
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove restore button (Access 2000)

    Wow, that was quick! Ta for that Hans.
    I did as you instructed but, I seem to have missed something; I'm getting a "Compile error; Sub or function not defined"
    ?

  6. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remove restore button (Access 2000)

    What is highlighted when you get the compile error?

    Aren't you frying tonight any more?

  7. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remove restore button (Access 2000)

    Michael,

    Thanks for the demo. It serves a different purpose however.

    When you set the MinMaxButtons property of a form to No to hide the minimize and maximize/restore buttons, then maximize the form in code, Access will display the restore button in the menu bar. The code from Dev Ashish's Access Web demonstrates a way to "maximize" a form without having a restore button.

    The code in your demo disables the Close box of the Access application as a whole, so that users can't quit Access inadvertently. This can be very useful, but it is not the same as the code Egg'n'Bacon asked about.

  8. #7
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove restore button (Access 2000)

    Just this
    MaximizeRestoredForm

    NB I'm staggered by all your help, thnx

  9. #8
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove restore button (Access 2000)

    OOps - Next time I need to <img src=/S/rtfm.gif border=0 alt=rtfm width=24 height=23> question !!

    Michael

  10. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remove restore button (Access 2000)

    Don't worry - it's a useful demo too. It will probably help someone else.

  11. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remove restore button (Access 2000)

    If you created a new module and copied the code from the Access Web into it, Access should recognize the MaximizeRestoredForm procedure. If it doesn't, either the code is not there, or there is a type somewhere in the code.

    I have attached a small demo. The database contains just two objects: a module Module1 (how original) with the code from the Access Web (copied and pasted without any modification), and a form Form1 with the following properties:

    ScrollBars: None
    Record Selectors: No
    Navigation Buttons: No
    Border Style: None

    This is the code behind the form:

    ' For the Close button:

    Private Sub cmdClose_Click()
    DoCmd.Close
    End Sub

    ' Fake Maximize the form when loaded:

    Private Sub Form_Load()
    MaximizeRestoredForm Me
    End Sub
    Attached Files Attached Files

  12. #11
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove restore button (Access 2000)

    Sorted! Not au fait with using code, I'd used the tab key to space the second line in the code for the form, instead of the space bar. Changed that & voila! Thanks again Hans
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •