Disabel Menu Close button (x)

  • Thread starter Thread starter dastokes
  • Start date Start date
D

dastokes

How do I turn off or grey the close button (x) on the menu
bar I have attached to a form? I have been able to do
this with the Access close button (x) by programming it,
but am unable to determine how to get ahold of the menu's
handle in order to do this.

Thanks!!!

Deborah
 
In the properiteis sheet..set the "close buttion" to no.

You will also have to turn off the min/max buttions also.
 
Thanks Albert, but I've tried that and it works great for
the form, but not for the menu. I can't figure out how to
disable any close button (x) but the Access application's.

Thanks!!!
 
Are you talking about the main Access application "X" button in the upper right corner?
If so, try these techniques.
Take your pick based on version.

ACC: How to Disable the Close Button (X) on the Access
Application Window (95/97)
http://support.microsoft.com/?id=258049

ACC2000: How to Disable the Close Button (X) on the Access
Application Window
http://support.microsoft.com/?id=245746

ACC2002: How to Disable the Close Button (X) on the Access
Application Window and the Exit Command on the File Menu
http://support.microsoft.com/?id=300688

Alternatively, see:

http://www.mvps.org/access/general/gen0005.htm
 
I figured out how to disable the main Access
application "X" button. Now I'm trying to disable the "X"
that is on any Access menu whether standard or created by
me. Any ideas?

Thanks!!!!

-----Original Message-----
Are you talking about the main Access application "X"
button in the upper right corner?
 
Well I'm a little stumped here.
Menu bars/toolbars do not have an "X" button on them.
Are you absolutely sure it is not the form's "X" button you see?
If you have code in the form to maximize itself, the "X" will reappear EVEN IF you have set that
option to "No" on the form's properties list. So it may "look" like it is on a menu bar.
If you'd like to maximize the form, but not see that "X" you need to use this code:

http://www.mvps.org/access/api/api0022.htm
 
I tried that but it didn't seem to work. I didn't go very
far with this though. I'll work with it some more and see
if it'll lead me to what I'm wanting.

Thanks so much for your help!!! I'll get back with you on
the results.

Deb
-----Original Message-----
Well I'm a little stumped here.
Menu bars/toolbars do not have an "X" button on them.
Are you absolutely sure it is not the form's "X" button you see?
If you have code in the form to maximize itself, the "X"
will reappear EVEN IF you have set that
option to "No" on the form's properties list. So it
may "look" like it is on a menu bar.
 
Well, I've tried using the code, but the problem is that I
am opening forms on top of forms and when I return to the
original form, it no longer shows correctly in the
window. It becomes to long and wide. You were right,
though, it is the forms X that I'm trying to get rid of.

Any ideas on disabling the X on the form instead of
resizing the window? Just graying it out and making it
inactive would work...

Thanks!!!

-----Original Message-----
I tried that but it didn't seem to work. I didn't go very
far with this though. I'll work with it some more and see
if it'll lead me to what I'm wanting.

Thanks so much for your help!!! I'll get back with you on
the results.

Deb
-----Original Message-----
Well I'm a little stumped here.
Menu bars/toolbars do not have an "X" button on them.
Are you absolutely sure it is not the form's "X" button you see?
If you have code in the form to maximize itself, the "X"
will reappear EVEN IF you have set that
option to "No" on the form's properties list. So it
may "look" like it is on a menu bar.
If you'd like to maximize the form, but not see that "X" you need to use this code:

http://www.mvps.org/access/api/api0022.htm

--
Jeff Conrad
Access Junkie
Bend, Oregon

 
Ok, let's step back a minute and make sure we are on the same page.
You've kinda given us half of the puzzle pieces through various posts.
So let's summarize:

1. You are not trying to hide the main Access Application "X" correct?
(You may be doing that anyway)

2. You say "original form" so is this the ONLY form with the problem?

3. Go to the Form's properties list for the "original form."
Is this form Pop-Up set to Yes?
Is this form Modal set to Yes?
Is the Close Button Property set to No?
Do you have ANY DoCmd.Maximize statements for this form?

4. Are your other forms set to Pop-Up?
Do you have ANY other forms/reports with a DoCmd.Maximize statement?

Here's my guess:
Your original form has the Close Property set to No.
You open another form on top of this one that has a DoCmd.Maximize line.
That second form fills the screen and has a "X" button because it is maximized.
You close that form and return back to the original form.
Now suddenly your original form is maximized and has a "X" button in the upper right corner.
That's because of how Access treats the window state: Once maximized - all maximized.

Things to try:
1. Put a DoCmd.Restore command in EVERY form and report's Close event.
This will keep each form/report window state the way you'd like it.

2. Experiment with the code link I gave you some more.
If you have your form set to Pop-Up you will see some strange things.
Try setting Pop-Up to No and then use the code.
The form will fill the entire Access Window, but allow room for the menubars/toolbars.
Also, you will not see an "X" button then.

3. Triple check to make sure you have set the Close Button property to No on any forms you do not
wish to see it. Remember though that a DoCmd.Maximize command will just override that.

--
Jeff Conrad
Access Junkie
Bend, Oregon

dastokes said:
Well, I've tried using the code, but the problem is that I
am opening forms on top of forms and when I return to the
original form, it no longer shows correctly in the
window. It becomes to long and wide. You were right,
though, it is the forms X that I'm trying to get rid of.

Any ideas on disabling the X on the form instead of
resizing the window? Just graying it out and making it
inactive would work...

Thanks!!!

-----Original Message-----
I tried that but it didn't seem to work. I didn't go very
far with this though. I'll work with it some more and see
if it'll lead me to what I'm wanting.

Thanks so much for your help!!! I'll get back with you on
the results.

Deb
-----Original Message-----
Well I'm a little stumped here.
Menu bars/toolbars do not have an "X" button on them.
Are you absolutely sure it is not the form's "X" button you see?
If you have code in the form to maximize itself, the "X"
will reappear EVEN IF you have set that
option to "No" on the form's properties list. So it
may "look" like it is on a menu bar.
 
Sorry I haven't been to clear. Let me tell you what's
going on.
I open up a main form (my "switchboard" but not created
through the switchboard manager. I have "things" I need
to do that the manager won't easily let me do.)

From this form other forms are opened. I am unable to use
use Pop-up or Modal for most of the forms that are called
from here. (I've tried this and just can't get the
results I want.)

The forms opened by the "switchboard" now call other forms
(I am able to make these pop-up). When I return from the
forms called here to the "switchboard", the "switchboard"
is no longer of the correct size.

To answer your questions:
I am not trying to hid the main Access Application "X" and
yes I am already doing this.

The original form ("switchboard") is the only one with the
problem.

Pop-Up is set to No
Modal is set to No
Close Button is set to No
I have gotten rid of all DoCmd.Maximize lines

I wish I could make the forms I call from the Switchboard
Pop-up or Modal, but I can't. (I tried that one)

I've finally decided that what I need is to be able to
disable the form close button programatically just as I
have done to the main Access Application "X". I think
I've tried just about everything else!!!

I'm using Access 97 and there's no option of upgrading.

Thanks for keeping on with this one. I am usually able to
find solutions to problems I encounter. This one is
driving me crazy!!! (not hard to do...)

-----Original Message-----
Ok, let's step back a minute and make sure we are on the same page.
You've kinda given us half of the puzzle pieces through various posts.
So let's summarize:

1. You are not trying to hide the main Access Application "X" correct?
(You may be doing that anyway)

2. You say "original form" so is this the ONLY form with the problem?

3. Go to the Form's properties list for the "original form."
Is this form Pop-Up set to Yes?
Is this form Modal set to Yes?
Is the Close Button Property set to No?
Do you have ANY DoCmd.Maximize statements for this form?

4. Are your other forms set to Pop-Up?
Do you have ANY other forms/reports with a DoCmd.Maximize statement?

Here's my guess:
Your original form has the Close Property set to No.
You open another form on top of this one that has a DoCmd.Maximize line.
That second form fills the screen and has a "X" button because it is maximized.
You close that form and return back to the original form.
Now suddenly your original form is maximized and has
a "X" button in the upper right corner.
That's because of how Access treats the window state:
Once maximized - all maximized.
Things to try:
1. Put a DoCmd.Restore command in EVERY form and report's Close event.
This will keep each form/report window state the way you'd like it.

2. Experiment with the code link I gave you some more.
If you have your form set to Pop-Up you will see some strange things.
Try setting Pop-Up to No and then use the code.
The form will fill the entire Access Window, but allow
room for the menubars/toolbars.
Also, you will not see an "X" button then.

3. Triple check to make sure you have set the Close
Button property to No on any forms you do not
wish to see it. Remember though that a DoCmd.Maximize
command will just override that.
 
Well... got it figured. Did a combination of things. on
the code line I reduced the length and width (MoveWindow
F.hWnd, 0, 0, (MDIRect.x2 - MDIRect.x1) - 3, (MDIRect.y2 -
MDIRect.y1) - 3, True) and I made the "switchboard" and
first forms modal. All other forms I made pop-up. Except
for reports I am no longer seeing the "X" (I don't care
about it showing in the reports).

Thanks for all your help!!!!

-----Original Message-----
Sorry I haven't been to clear. Let me tell you what's
going on.
I open up a main form (my "switchboard" but not created
through the switchboard manager. I have "things" I need
to do that the manager won't easily let me do.)

From this form other forms are opened. I am unable to use
use Pop-up or Modal for most of the forms that are called
from here. (I've tried this and just can't get the
results I want.)

The forms opened by the "switchboard" now call other forms
(I am able to make these pop-up). When I return from the
forms called here to the "switchboard", the "switchboard"
is no longer of the correct size.

To answer your questions:
I am not trying to hid the main Access Application "X" and
yes I am already doing this.

The original form ("switchboard") is the only one with the
problem.

Pop-Up is set to No
Modal is set to No
Close Button is set to No
I have gotten rid of all DoCmd.Maximize lines

I wish I could make the forms I call from the Switchboard
Pop-up or Modal, but I can't. (I tried that one)

I've finally decided that what I need is to be able to
disable the form close button programatically just as I
have done to the main Access Application "X". I think
I've tried just about everything else!!!

I'm using Access 97 and there's no option of upgrading.

Thanks for keeping on with this one. I am usually able to
find solutions to problems I encounter. This one is
driving me crazy!!! (not hard to do...)

-----Original Message-----
Ok, let's step back a minute and make sure we are on the same page.
You've kinda given us half of the puzzle pieces through various posts.
So let's summarize:

1. You are not trying to hide the main Access Application "X" correct?
(You may be doing that anyway)

2. You say "original form" so is this the ONLY form with the problem?

3. Go to the Form's properties list for the "original form."
Is this form Pop-Up set to Yes?
Is this form Modal set to Yes?
Is the Close Button Property set to No?
Do you have ANY DoCmd.Maximize statements for this form?

4. Are your other forms set to Pop-Up?
Do you have ANY other forms/reports with a
DoCmd.Maximize
statement?

Here's my guess:
Your original form has the Close Property set to No.
You open another form on top of this one that has a DoCmd.Maximize line.
That second form fills the screen and has a "X" button because it is maximized.
You close that form and return back to the original form.
Now suddenly your original form is maximized and has
a "X" button in the upper right corner.
That's because of how Access treats the window state:
Once maximized - all maximized.
Things to try:
1. Put a DoCmd.Restore command in EVERY form and
report's
Close event.
This will keep each form/report window state the way you'd like it.

2. Experiment with the code link I gave you some more.
If you have your form set to Pop-Up you will see some strange things.
Try setting Pop-Up to No and then use the code.
The form will fill the entire Access Window, but allow
room for the menubars/toolbars.
Also, you will not see an "X" button then.

3. Triple check to make sure you have set the Close
Button property to No on any forms you do not
wish to see it. Remember though that a DoCmd.Maximize
command will just override that.
 
Sorry I haven't been to clear. Let me tell you what's going on.
I open up a main form (my "switchboard" but not created
through the switchboard manager. I have "things" I need
to do that the manager won't easily let me do.)

Ok fine.
From this form other forms are opened. I am unable to use
use Pop-up or Modal for most of the forms that are called
from here. (I've tried this and just can't get the results I want.)

That's odd, I've never had any trouble with this.
ALL of my forms are Modal and it works just fine for me.
Not sure what the problem might be for you.
The forms opened by the "switchboard" now call other forms
(I am able to make these pop-up). When I return from the
forms called here to the "switchboard", the "switchboard"
is no longer of the correct size.

Does the "switchboard" then show the "X" button?
If so, it HAS to be because of the Access window state.
To answer your questions:
I am not trying to hid the main Access Application "X" and
yes I am already doing this.
Ok.

The original form ("switchboard") is the only one with the problem.
Ok.

Pop-Up is set to No
Modal is set to No
Close Button is set to No
I have gotten rid of all DoCmd.Maximize lines

Good.
But, what about on reports????
If you are opening ANY reports from ANY forms and if even ONE of them has a DoCmd.Maximize line,
then the forms will follow suit and become maximized which will show the "X" button.
Did you do as I suggested and put a DoCmd.Restore line in EVERY form AND report's Close event?
I honestly think that will solve the problem for you.
I do this all the time just to make sure things are not getting messed up.
I wish I could make the forms I call from the Switchboard
Pop-up or Modal, but I can't. (I tried that one)

As mentioned earlier not sure what the problem is.
I've finally decided that what I need is to be able to
disable the form close button programmatically just as I
have done to the main Access Application "X". I think
I've tried just about everything else!!!

I'm not sure if you can do this programmatically.
I still prefer the code here if I want to maximize a form:

http://www.mvps.org/access/api/api0022.htm
I'm using Access 97 and there's no option of upgrading.

Nothing wrong with Access 97, it's very stable.
Thanks for keeping on with this one. I am usually able to
find solutions to problems I encounter. This one is
driving me crazy!!! (not hard to do...)

No problem.
I would add the DoCmd.Restore lines to every form and report's Close event and see what happens.
 
Back
Top