PgDn and PgUp

  • Thread starter Thread starter Kevin D.
  • Start date Start date
K

Kevin D.

I have a form (Single Form View) with multiple pages separatd by page breaks.
When pressing the pgdn or pgup buttons, I want to move to either the next or
previous records, not to pages of the form. How can I accomplish this?

Thanks.

Kevin D.
 
Kevin,

You can set the forms "Key Preview" property to Yes and then use the "On Key
Press" event to trap for the PgUp and PgDown keys. Once you know the key
that was pressed you can then use that information to move to the next or
previous record with code like:

'move to the next record
DoCmd.RunCommand acCmdRecordsGoToNext

'move to the previous record
DoCmd.RunCommand acCmdRecordsGoToPrevious

Be sure to think about how to manage being on the first record or being on
the last record.

HTH
Mr. B
askdoctoraccess dot com
 
Back
Top