Fields and sequence

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
What code have you assigned to the various arrow keys, and where have you
placed it?

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

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
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]
 
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
 

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

Back
Top