Solved

Blocking CTRL-F4

Posted on 2004-09-23
5
201 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
  • 3
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
Data-Man earned 33 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
worth a A grade!!!

thanks a million!
0
 
LVL 18

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now