PgDown gets new record

  • Thread starter Thread starter nayana
  • Start date Start date
N

nayana

Guest
In my Application I have designed a form that calls another form having inofrmation of a "specific record" in the database


BUT MY PROBLEM IS when I hit PgDown key a few times it shows me a blank record form, when I do PgUp the record apears again,

WHY DOES THE BLANK RECORD APPEAR
How Can I lock the form to show only that record
 
You could disable the PageUp and Down buttons. Ensure the forms "Key Preview" property is set to YES when using this code with the forms "On Key Down" event.

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyPageUp, vbKeyPageDown
KeyCode = 0
End Select
End Sub

HTH
 
Open the form in design view and bring up the properties sheet for the form. Click the Other tab and look for the Cycle option. You can select Current Record option so that as the user tabs through the form, and reaches the last field, it will tab back to the beginning. This, however, doesn't stop the Page up, Page down keys from cycling to the next record. You'd need to use the code that ghudson's given to stop users from using those keys.

If you're unsure of a response you've had to a post, it's best to continue with the same post rather than start a new one, which doesn't mean anything to anybody.

HTH
 

Users who are viewing this thread

Back
Top Bottom