Disabling and Re-enabling Keys

P

Peter Hallett

A form is displayed with the focus set to the first control requiring data
input, which is then solicited in sequence. The form works fine. However,
for a reason which is far from clear, some operators have been using the Page
Down key which then displays the next page. In most cases this is blank,
effectively clearing all the controls and leading the operator to conclude
that he has ‘lost his data’. It can, of course, easily be retrieved by means
of the Page Up key, if this is pressed the same number of times as the Page
Down key but an easier way of dealing with this problem might simply be to
disable the Page Up and Page Down keys while the form is on display.
Unfortunately, however, the On Key Press event does not appear to do
anything. A break point inserted in the resulting Sub is never reached. Can
anyone suggest a solution?
 
J

Jeff Boyce

Peter

Open the form in design view. Check for the property setting for "Cycle".
If you set it to "Current Record", I believe the page-down/page-up doesn't
leave the current record.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
R

Rick Brandt

Jeff said:
Peter

Open the form in design view. Check for the property setting for "Cycle".
If you set it to "Current Record", I believe the page-down/page-up doesn't
leave the current record.

Cycle only affects usage of the Tab key, not the Page keys.
 

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