Connecting Tech Pros Worldwide Forums | Help | Site Map

Tab down through a continuous form- new records first then same in new field Acc 2003

Newbie
 
Join Date: Jul 2009
Posts: 1
#1: Jul 2 '09
Hi all,

Please excuse me if this is incorrect I am new to MS access and this Forum and appreciate any advice on posting.

I would Like the Tab key on the key board to take the cursor down through a continuous form then across (am happy to do the across bit manually) and continue down the next field. I have looked all over the internet for answers but found only turning the "tab stop" to off. This only works when you only want to go down one of the columns (multiple records in one field)...
Does anyone have any VBA code or tips for the Tab key moving through all the records (in one field) on a continuous form before being taken across to the other fields on the form (then being capable of going down the next field the same)?

the (standard) "Tab order" does obviously not work because it is a continuous form and Tab order doesn't have the option of down the records first.

thanks in advance for your time

Miki

beacon's Avatar
Needs Regular Fix
 
Join Date: Aug 2007
Posts: 279
#2: Jul 2 '09

re: Tab down through a continuous form- new records first then same in new field Acc 2003


Hi Miki,

Check out this webpage: http://www.techonthenet.com/access/f...ol_nextrec.php

I chose a slightly different method because it prevents you from having to set the key down for every field on your continuous form. I use the Form_KeyPress event to move the cursor down no matter what field you are on for the current record.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_KeyPress(KeyAscii As Integer)
  2.     Dim myKey
  3.  
  4.     myKey = KeyAscii
  5.  
  6.     If myKey = 9 Then               'Tab key is pressed
  7.         Me.YourField.SetFocus   'Sub YourField with any field on your form. I used the first field on my form.
  8.         DoCmd.GoToRecord       'Go to record will move to the next instance of (or set the focus to) YourField on the form.
  9.     Else
  10.         'Do nothing
  11.     End If
  12.  
  13. End Sub
  14.  
Reply