A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Right and Left Arrow Keys



 
 
Thread Tools Display Modes
  #1  
Old November 4th, 2009, 08:57 PM posted to microsoft.public.access.forms
User via AccessMonster.com
external usenet poster
 
Posts: 28
Default Right and Left Arrow Keys

I have a form with two command buttons:

cmdNextRecord
cmdPreviousRecord

Is there coding out there that will allow the user to control the command
button "cmdNextRecord" On Click Event with the keyboard's right arrow key?...
And the command button "cmdPreviousRecord" with the left arrow key?

Any help would be great!!!!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

  #2  
Old November 5th, 2009, 02:38 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Right and Left Arrow Keys

Not sure how to code for the right/left arrow keys, but you users can use the
PageUp and PageDown keys to scroll among the records.

--
Daryl S


"User via AccessMonster.com" wrote:

I have a form with two command buttons:

cmdNextRecord
cmdPreviousRecord

Is there coding out there that will allow the user to control the command
button "cmdNextRecord" On Click Event with the keyboard's right arrow key?...
And the command button "cmdPreviousRecord" with the left arrow key?

Any help would be great!!!!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

.

  #3  
Old November 5th, 2009, 03:03 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Right and Left Arrow Keys

For the form, goto Properties - Events and set Key Preview to Yes.

Then use this code:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyRight Then Call cmdNextRecord_Click
If KeyCode = vbKeyLeft Then Call cmdPreviousRecord_Click
End Sub

But I have to warn you, most users are going to expect the Left/Right arrows
to move the cursor to the left or right and might not like to find out that
standard functions have been removed!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

  #4  
Old November 7th, 2009, 07:57 PM posted to microsoft.public.access.forms
User via AccessMonster.com
external usenet poster
 
Posts: 28
Default Right and Left Arrow Keys

Events and set Key Preview to Yes.

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyRight Then Call cmdNextRecord_Click
If KeyCode = vbKeyLeft Then Call cmdPreviousRecord_Click
End Sub


Works Great!!!

Thank You!!!!!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

  #5  
Old November 8th, 2009, 04:29 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Right and Left Arrow Keys

Glad we could help!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.