disable page-up, page-down

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top