Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catch all deletes

Status
Not open for further replies.

JBirdieH

Technical User
May 22, 2001
37
US
I would like to catch any keystrokes relating to deletion of a record and send the user to an interactive q & a. This would probably be at the form level? Would you have to account for all varieties of keyphysical or is there a blanket that would work better? Thanks.
 
To ensure that the user is restricted to entering and deleting data only through the form, I use buttons on the form to enter and exit edit mode (code on these also do validity checks on the data). I also trap "unwanted" keypresses in the keyphysical method on the form and use my own menus to control user menu access. If the user can open the table directly, (File/Open/Table) then he/she can do whatever they want. Sample code for form keyPhysical follows:

method keyPhysical(var eventInfo KeyEvent)
var
theKey String
endvar
if eventInfo.isPreFilter()
then
; This code executes for each object on the form.
theKey = eventInfo.vChar()
switch
case (theKey = "VK_F7"):
;stop user viewing table directly
disableDefault
case theKey = "VK_F8" :
;stop user entering design mode
disableDefault
case theKey = "VK_F9" :
;stop user entering/exiting edit mode
disableDefault
case theKey = "VK_F10" :
;only access menu via mouse
disableDefault
case (theKey = "VK_F11") or (theKey = "VK_F12") :
;stop the user using keys to navigate
disableDefault
case theKey = "VK_DELETE" :
if eventInfo.isControlKeyDown() then
disableDefault
endif
endswitch
else
; This code executes only for the form.
endif
endMethod

HTH PAdraig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top