Fields and sequence

S

sanjay

hi,

i have 4 currency fields on my form. field1 acccepts a value and control
passes to field2. in field2 when the left arrow and up arrow are pressed the
vba passes the control to field1 thats ok. now if the down arrow or the right
arrow are pressed then the conrol passes to field3....although the vba is the
same for all the arrow keys ... why does the down arrow and right arrow when
pressed ignore the vba code and pass the control to field3 when the code is
specifies it field1?

thanks

Sanjay mehta
 
M

missinglinq via AccessMonster.com

What code have you assigned to the various arrow keys, and where have you
placed it?
 
J

John W. Vinson

why does the down arrow and right arrow when
pressed ignore the vba code and pass the control to field3 when the code is
specifies it field1?

Presumably because of some error in the code. Please post it so we can see it
and help you diagnose the error.

John W. Vinson [MVP]
 
S

sanjay

hi John,

the vba code is as follows:

Private Sub field3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyDown Or KeyCode = vbKeyRight Or KeyCode = vbKeyReturn
Then
DisplaySwitch = 0:
DoCmd.GoToControl "field1":
End If
If KeyCode = vbKeyUp Or KeyCode = vbKeyLeft Then
DisplaySwitch = 0:
DoCmd.GoToControl "field1":
End If
End Sub

A) in field3 if keyup or keyleft then control goes to field1 ... ok

B) in field 3 if keydown or keyright pressed then control goes to field4 ...
not ok .. should goto field1!

why is the vba code ignored in (B)?

Thanks

Sanjay Mehta
 
Top