?
Solved

Blocking CTRL-F4

Posted on 2004-09-23
5
Medium Priority
?
223 Views
Last Modified: 2006-11-17

Hello Smart Folk,

Anyone got a code snippet that will stop my users being able to close a form with CTRL-F4?

Thanks,

M
0
Comment
Question by:Moother
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
Data-Man earned 132 total points
ID: 12132827
use the keydown event at the form level to check for the that cobination and then set the keycode to 0

Mike
0
 
LVL 3

Author Comment

by:Moother
ID: 12133782
any idea how to do that so my pc will understand it?

I know the principle..., but lack the talent...
0
 
LVL 18

Expert Comment

by:Data-Man
ID: 12133927
Put this code inside the keydown event for the form.

Also set the key preview property to yes.


If (Shift And acCtrlMask) > 0 And KeyCode = vbKeyF4 Then
    KeyCode = 0
End If

Mike
0
 
LVL 3

Author Comment

by:Moother
ID: 12134375
worth a A grade!!!

thanks a million!
0
 
LVL 18

Expert Comment

by:Data-Man
ID: 12134392
too bad it wasn't worth a million....LOL...Mike
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 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