473,378 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

No close (x) buttom for the access

Hi,

Is it possible to remove the access-application close-button (X)

Filip
Nov 12 '05 #1
2 1390
Not per se, but there are ways of preventing its use.
See www.mvps.org/access/forms

HTH
- Turtle

"Filips Benoit" <be***********@pandora.be> wrote in message
news:r4******************@phobos.telenet-ops.be...
Hi,

Is it possible to remove the access-application close-button (X)

Filip

Nov 12 '05 #2
Yes, I found time ago (I can not remember where) this VBA code that
makes Access "X" disabled; it works perfectly in Access 97 I did not
try on newer versions:

Put this on a module and call bas106_DisableX (this name is mine, you
can change if you want)

Please, pay attention to word wrapping:

***** Code start **************
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 Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As
Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long)
As Long

Public Const MF_BYPOSITION = &H400&
Public Const MF_REMOVE = &H1000&

Public Function bas106_DisableX()

Dim hMenu As Long
Dim nCount As Long

hMenu = GetSystemMenu(Application.hWndAccessApp, 0)
nCount = GetMenuItemCount(hMenu)

'Get rid of the Close menu and its separator
Call RemoveMenu(hMenu, nCount - 1, MF_REMOVE Or MF_BYPOSITION)
Call RemoveMenu(hMenu, nCount - 2, MF_REMOVE Or MF_BYPOSITION)

'Make sure the screen updates
'our change
DrawMenuBar Application.hWndAccessApp

End Function

***** Code end ******************

Regards.

Angel.

"MacDermott" <ma********@nospam.com> wrote in message news:<i9*****************@newsread1.news.atl.earth link.net>...
Not per se, but there are ways of preventing its use.
See www.mvps.org/access/forms

HTH
- Turtle

"Filips Benoit" <be***********@pandora.be> wrote in message
news:r4******************@phobos.telenet-ops.be...
Hi,

Is it possible to remove the access-application close-button (X)

Filip

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jens Peter Hansen | last post by:
Hi From my main window I open a series of popup (one close - next opens) in a mockup for a registration proces. From the last popup, I want to click a buttom, so the popup closes and the URL in...
3
by: Benne | last post by:
Hi, Does anybody know if it's possible to have the small "x" on the tabpages in a tabcontrol ? I need a nice way to close them, without a big, ugly buttom on the tabpage itself. It would be cool...
6
by: Frank L | last post by:
I have some accounting and tax receipting type applications, developed for charitable and non profit groups, that are exhibiting strange behaviour on a few of the 30 or 40 user machines. When...
6
by: scott | last post by:
I guess this is a simple one but I can't seem to get it to work. I want to refresh an open form "onClose" of another. I have a Close button on a form which has User Details on it. If I update...
1
by: Daniel | last post by:
Hi, I learn visual c++, and I have made an example with the IDE environnement,( MFC exe). I add a buttom and I want when the buttom is clicked, open an other formview that I created in my...
8
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
4
by: bbqbbq | last post by:
Hi Guys, I am creating a new aspx web page which allows user enter information and show the a message on a label text once them click the "submit" bottom. The label is placed at the end of the...
2
by: =?Utf-8?B?S2Vsdmlu?= | last post by:
Hi all, I am trying to create a new window (without border, title bar..etc) for using brush to make the whole screen become red. So, anyone knows how to create a new window after pressing a...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.