Cycling

  • Thread starter Thread starter Michael Wong
  • Start date Start date
M

Michael Wong

I use a bound form to enter new entries to my database.
The properties of the form are:

Cycle = Current Record
Data Entry = Yes
Allow Additions = Yes

But while entering data in the form, if I press on Page Down, I am brought
to a new data entry form. It's a bit wierd for a new user...
I have tried Data Entry = No, but then I could not open the form.

What should I do?
 
"Michael Wong" said:
The properties of the form are:

Cycle = Current Record
Data Entry = Yes
Allow Additions = Yes

But while entering data in the form, if I press on Page Down, I am brought
to a new data entry form. It's a bit wierd for a new user...
I have tried Data Entry = No, but then I could not open the form.

What should I do?

Michael

You can set the Form's KeyPreview to Yes, so that it receives keystrokes before
the active control, and then check the keys pressed in the Form's KeyDown
event:


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo E_Handle
Select Case KeyCode
Case vbKeyPageDown, vbKeyPageUp
KeyCode = 0
End Select
sExit:
Exit Sub
E_Handle:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error: " & Err.Number
Resume sExit
End Sub
 
Back
Top