Solved

Access '97 remove form Close button - How to ?

Posted on 2000-02-15
6
302 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
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 …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

746 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

13 Experts available now in Live!

Get 1:1 Help Now