Navigating in Continuous Form

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

Guest

Is there any way to navigate through a continuous form without using the tab
key. My form is set up with 10 fields, but some records may only require 2
fields. Is there a way for the user to go to the next record without tabbing
through the unused fields?
 
What about pressing the arrow keys to go down to the next record?
Or do you want the user to press the TAB key and access to recognize that
there are no more values and move to the next record?

About the second option there are some code to be made.
One option will be, on the on current event of the form, to check if there
is value in the field and set the TabStop Property.

me.Field1Name.TabStop = not isnull(Me.Field1Name)
me.Field2Name.TabStop = not isnull(Me.Field2Name)
me.Field3Name.TabStop = not isnull(Me.Field3Name)
 
If you got datasheet, then the up/down arrows do work.

However, if you use a continues form (which is what I use *most* of the
time), then I simply add the following code to the form, and the up/down
arrow keys then work.

Add the code to the forms keydown event...

' key hand

Select Case KeyCode

Case vbKeyUp
KeyCode = 0
On Error Resume Next
DoCmd.GoToRecord acActiveDataObject, , acPrevious

Case vbKeyDown
KeyCode = 0
On Error Resume Next
DoCmd.GoToRecord acActiveDataObject, , acNext


End Select

You also have to set the forms "keypreview" to yes for the above to work...
 
Back
Top