When I use me.maximize, or use a macro to maximize the form a restore button appear in the top right of the form, and I don't want to show that restore button, but only maximize the form.
To make it so that the maximize/restore buttons are not present, go to the properties of the form in form design, and on the format tab change the "min max button" property to none. Let me know if this helps ya...Dawn
Unfortunately, none of the above suggestions (except Kathie70's) will disable the Close/Exit button when the form is maximised.
When an Access form is maximised, Access automatically adds a functioning Close button to the form. Yes, you can disable the Minimise/Maximise buttons, but NOT the Close button. (Been There, Tried That!)
My Work-around solution was to set the form size so that it filled the screen by dragging the border, and then saving the form. Then when the form was opened, I use the DoCmd.RESTORE command to restore it to that size. The form appears to be maximised, but actually is not. Thus, no Close button.
Kathie70, Your solution works, but the menu bar and the tools bar disapear. If you now a way to show the bars and maximize the form, please let me now.
Change the form to a pop-up form and change the border Style property on the form to "none". This should get rid of all the buttons in the corner.
You could then create custom command buttons for the user to close the form and a put a rectangle around your form so that it appears to still have a border.
I can not remember who steered me to the following code,
( I would have liked to give them the credit due)but it
works great for me. remember to include the
DoCmd.Maximize in your OnActivate event.(I found
that if you switch back and forth between opened forms,
it sometimes does not "maximize" in the right position.)
Place the following in the Form_YourSplashformname_OnOpen
event: RemoveCloseButton Me.hwnd
Copy the following into a NEW module:
************************************************************
Option Compare Database
Option Explicit
Public Const MF_BYPOSITION = &H400
Public Const MF_REMOVE = &H1000
Public Declare Function DrawMenuBar Lib "user32" _
(ByVal hwnd As Long) As Long
Public Declare Function GetMenuItemCount Lib "user32" _
(ByVal hMenu As Long) As Long
Public Declare Function GetSystemMenu Lib "user32" _
(ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Public Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Public Sub RemoveCloseButton(hwnd As Long)
Dim hSysMenu As Long
hSysMenu = GetSystemMenu(hwnd, 0)
RemoveMenu hSysMenu, 6, MF_BYPOSITION
RemoveMenu hSysMenu, 5, MF_BYPOSITION
End Sub
************************************************************
I have not had any problems with this since I added it to
my DB.
OOPS!!! I forgot that you need to create your own custom
"menu" bar and in the start up options in the tools menu
select this new custom menu bar and right click on the toolbars select customize and then deselect the access
pre-built menu bar.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.