How to remove the control box, close, min max buttons

A

Angel b1

I’m trying to remove the control box, close and min max buttons on a form.
I set the control, close and min max properties to no
The form still displays the boxes.
I then set the form pop up property to yes and the boxes go away.
My problem is my print buttons will not work after the form pop up property
is set to yes

Here is the code under my print button.
strFilter = "qry_selectMemberRequest" & txtMemberID
DoCmd.OpenReport "rpt_SelectMemberRequest", acViewPreview, strFilter,
"tbl_memberOverrides.memberID = txtMemberID"

Im not sure what Im doing wrong.
 
J

Jeff Conrad

I believe the cause of your problem is actually something you left out. If you have the form
maximized by using a DoCmd.Maximize statement in the form's Open or Load event, you will still see
the Restore and Close button for the form. This behavior will override your "No" settings on the
form's Properties sheet.

In order to have the best of both worlds with a *maximized* form and no restore/close buttons is to
use the code found here:

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

I use it all the time and it works great.
Your report will open on top of the form so turn the Pop Up property for the form off.
 
H

hermie

Hello Jef

Where to put this code?

Herman

Jeff Conrad said:
I believe the cause of your problem is actually something you left out. If you have the form
maximized by using a DoCmd.Maximize statement in the form's Open or Load event, you will still see
the Restore and Close button for the form. This behavior will override your "No" settings on the
form's Properties sheet.

In order to have the best of both worlds with a *maximized* form and no restore/close buttons is to
use the code found here:

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

I use it all the time and it works great.
Your report will open on top of the form so turn the Pop Up property for the form off.
 
J

Jeff Conrad

Hi Herman,

1. Copy and paste all that code from the link into a new standard module
2. Compile the code
3. Close the module, save, and name it modMaximizeToWindow
4. Open the form in question in Design View
5. On the form's property sheet set the following properties:

Pop Up - No
Control Box - No
Min Max Buttons - None
Close Button - No

6. Make sure you have a command button on the form that will actually close the form!
7. In the form's Open event put this one line of code:

MaximizeRestoredForm Me

8. Compile the code
9. Close the form and save
10. Open the form in normal view to see the results. The form will *fill up* the available window
screen area allowing room for the menu bars/toolbars, but not showing any Restore or Close button.

Bada bing, like magic!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top