469,609 Members | 1,666 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Scrolling back records on a data entry form...

MLH
On a data entry only form. lets say a user opens your form and enters
4 consecutive records. Each time, he clicks your SAVE button and
a record is save and the record set is advanced to a newrec.

I don't know how to prevent the user from pressing the PGUP key
or other keystrokes to back up a record or two. Its not exactly what
I want them to do and sometimes causes data entry errors.

Is there a way in A97 or Access 2.0 to prevent a user from leaving
a newrec, going backwards into records previously entered in the
same form session?
Nov 13 '05 #1
4 1662
Put the following code in the form's KeyDown event:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 33, 34
KeyCode = 0
End Select
End Sub

This will disable use of PgUp and PgDn for that form.
-Ed

"MLH" <CR**@NorthState.net> wrote in message
news:4j********************************@4ax.com...
On a data entry only form. lets say a user opens your form and enters
4 consecutive records. Each time, he clicks your SAVE button and
a record is save and the record set is advanced to a newrec.

I don't know how to prevent the user from pressing the PGUP key
or other keystrokes to back up a record or two. Its not exactly what
I want them to do and sometimes causes data entry errors.

Is there a way in A97 or Access 2.0 to prevent a user from leaving
a newrec, going backwards into records previously entered in the
same form session?

Nov 13 '05 #2
MLH
Ed - very handy and useful procedure. Thx a lot.
It didn't work, at first. But after I changed the
form's KeyPreview property to True, it worked
like a champ. Many thx.
Nov 13 '05 #3
MLH
Ed, how can I read my own keycodes?
For example, I do not know what keycodes
33 and 34 are. I assume they are the PGDN
key and something else???
Nov 13 '05 #4
Have you looked in the VBA help file?

Try looking for ascii or character set.

Jeff

"MLH" <CR**@NorthState.net> wrote in message
news:dt********************************@4ax.com...
Ed, how can I read my own keycodes?
For example, I do not know what keycodes
33 and 34 are. I assume they are the PGDN
key and something else???

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Wesman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.