Solved

Access '97 remove form Close button - How to ?

Posted on 2000-02-15
6
307 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

786 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