Solved

Access '97 remove form Close button - How to ?

Posted on 2000-02-15
6
305 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now