Solved

Blocking CTRL-F4

Posted on 2004-09-23
5
212 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 33 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

739 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