disable page-up, page-down

  • Thread starter Thread starter Wendy
  • Start date Start date
W

Wendy

Hi all,
Is there a way to prevent a form from leaving the current
record when you press the Page-up or Page-down keys. I
tried trapping the keystroke by using "On Key Down" and
setting "key preview = Yes" but it dosen't work if the
active control is a Tab-Control. If the active control is
a field IN the Tab-Control then the key preview trap does
work.

Please help

Thanks,
Wendy
 
I use the following code in the form's On Key Down
property with Key Preview set to yes. This disables pgup,
pgdwn, & esc. You can remove case 27 if you want to
enable esc (undo)

Select Case KeyCode
Case 27, 33, 34
KeyCode = 0
End Select
 
Back
Top