dbTalk Databases Forums  

Stopping Up/Down = Prev/Next?

comp.databases.ms-access comp.databases.ms-access


Discuss Stopping Up/Down = Prev/Next? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
FrankBooth
 
Posts: n/a

Default Stopping Up/Down = Prev/Next? - 07-28-2003 , 08:19 PM






OK Every posting I'm reading on this states that you should Set Key
Preview to Yes on the form, then place the following code into the
KeyDown even: If (KeyCode = vbKeyDown Or KeyCode = vbKeyUp) Then
KeyCode = 0

Additionally I also have this code on a combo on the form:
If KeyCode = vbKeyDown Then SendKeys "{F4}", True

Seems simple enough, yet it is not working. If I set Key Preview to NO
the the combo code works but the record movement on Up/Down is active
and I do not want this.

I'm using Access v10.

Any help on might be happening here would be appreciated.

Thanks in advance,
--FB

Reply With Quote
  #2  
Old   
Jeff Bailey
 
Posts: n/a

Default Re: Stopping Up/Down = Prev/Next? - 07-29-2003 , 03:47 AM






Hi

Your problem, I think, is caused by the fact that you are using vbKeyDown
for 2 different actions. When the first event (Form KeyDown) detects the
down arrow your first bit of code runs - and sets KeyCode to zero. The
combo KeyDown never has a chance to fire cos the keycode has already been
set to zero.

Using a different key to drop the combo seems to be the simplest work
around, although I accept that this won't be as intuitive.

HTH

Jeff Bailey

"FrankBooth" <acg_acg (AT) hotmail (DOT) com> wrote

Quote:
OK Every posting I'm reading on this states that you should Set Key
Preview to Yes on the form, then place the following code into the
KeyDown even: If (KeyCode = vbKeyDown Or KeyCode = vbKeyUp) Then
KeyCode = 0

Additionally I also have this code on a combo on the form:
If KeyCode = vbKeyDown Then SendKeys "{F4}", True

Seems simple enough, yet it is not working. If I set Key Preview to NO
the the combo code works but the record movement on Up/Down is active
and I do not want this.

I'm using Access v10.

Any help on might be happening here would be appreciated.

Thanks in advance,
--FB



Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.