PgDn and PgUp

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.
 
M

Mr. B

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
 

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