Solved

Access '97 remove form Close button - How to ?

Posted on 2000-02-15
6
312 Views
Last Modified: 2012-05-04
This is driving me nuts!  This should be simple.

I have a form that I want to remove the buttons on the top-right (the 'X' on the top-right (close), etc.).

However, I also need the form maximized.

When I run the app, the form is presented maximized (docmd.maximize), but there is a close and a re-size button on the top-right of the form.  If I click the re-size button, the form re-sizes and both the re-size button and the close button go away!  While this is what I want, I need it in the maximized format of the form.

I have set min-max buttons to 'none', close button to 'no', and defined the 'thin' border style.

Any suggestions ?
0
Comment
Question by:chrissmith
6 Comments
 
LVL 10

Expert Comment

by:paasky
ID: 2524661
Hello chrissmith,

You want to prevent users to close the form?

Here's one work-around assuming you have your own close button on the form:

Option Compare Database
Option Explicit
Dim CloseForm As Boolean

Private Sub B_CloseForm_Click()
    ' Close allowed only with button
    CloseForm = True
    DoCmd.Close
End Sub

Private Sub Form_Unload(Cancel As Integer)
    ' Cancel event if user pushed window close button
    Cancel = Not CloseForm
End Sub

Regards,
Paasky
0
 

Author Comment

by:chrissmith
ID: 2524702
I have my own close button.  That's the point.  I want to remove the one that Access supplies.
0
 
LVL 7

Expert Comment

by:lmerrell
ID: 2524794
Set the form's Control Box property to "No".

lmerrell
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:chrissmith
ID: 2524825
I have already done that.  My apologies for not mentioning it.
0
 
LVL 10

Accepted Solution

by:
paasky earned 100 total points
ID: 2524852
I think it's a kind of weird feature (bug?) that the Close, Min and Max button appear into window right upper corner when the window is maximized. I tried to hide buttons with API but without suggess.

I just checked that this question has been asked here earlier and there was an API sample you might want to try / modify. See Q.10289239 (5 points).

Paasky
0
 
LVL 3

Expert Comment

by:tomk120999
ID: 2524881
This is another approach you might try.  Don't maximize the form, just size it to take up the whole screen while in the "window" mode.  Then all the "no buttons/menu" choices will be in effect, but the window will fill the whole screen.  The user then shouldn't be able to change window mode to "maximize", "close", or anything else unless they use your command buttons.  Let us know if that helps.
good luck as usual...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question