Back to the beginning of the form

  • Thread starter Thread starter kateri4482
  • Start date Start date
K

kateri4482

How do I get the cursor to start at the beginning of the form each and every
time after going to the next (or another) record?
 
Open form in design view and view Tab Order. Arrange tab so that the object
you want as first is at top of list.
 
Thank you - but the tab order is fine. What I mean is: if I am in, say, the
5th field of a record on a form, and then I go to the next record, the cursor
remains on the 5th field. I want it to start on the 1st field in the tab
order each time. Does that make sense?
 
put this code on the form Current event:

'~~~~~~~~~~~~~~
Private Sub Form_Current()
On Error Resume Next
Me.controlname.SetFocus
End Sub
'~~~~~~~~~~~~~~

WHERE
controlname is the name of the control you want to set the focus to


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*
 
kateri4482 said:
Thank you - but the tab order is fine. What I mean is: if I am in,
say, the
5th field of a record on a form, and then I go to the next record, the
cursor
remains on the 5th field. I want it to start on the 1st field in the
tab
order each time. Does that make sense?

You can add an OnCurrent event procedure to the form to set the focus to
your first control:

Private Sub Form_Current()
Me.[NameOfFirstControl].SetFocus
End Sub

Open form in design view and go to the events tab of the form property
sheet. Select [event procedure] from the OnCurrent dropdown list, and
paste the above code into the code window that appears when you click
the [...] code builder button.
 
Thank you. That did it.

Clif McIrvin said:
kateri4482 said:
Thank you - but the tab order is fine. What I mean is: if I am in,
say, the
5th field of a record on a form, and then I go to the next record, the
cursor
remains on the 5th field. I want it to start on the 1st field in the
tab
order each time. Does that make sense?

You can add an OnCurrent event procedure to the form to set the focus to
your first control:

Private Sub Form_Current()
Me.[NameOfFirstControl].SetFocus
End Sub

Open form in design view and go to the events tab of the form property
sheet. Select [event procedure] from the OnCurrent dropdown list, and
paste the above code into the code window that appears when you click
the [...] code builder button.
 
kateri4482 said:
Thank you. That did it.

You're welcome.

I hope you took note of Crystal's reply ... hers was better than mine.
<grin>
(error handling, *and* a link to excellent reference material!)
--
Clif
Still learning Access 2003


Clif McIrvin said:
kateri4482 said:
Thank you - but the tab order is fine. What I mean is: if I am in,
say, the
5th field of a record on a form, and then I go to the next record,
the
cursor
remains on the 5th field. I want it to start on the 1st field in
the
tab
order each time. Does that make sense?

You can add an OnCurrent event procedure to the form to set the focus
to
your first control:

Private Sub Form_Current()
Me.[NameOfFirstControl].SetFocus
End Sub

Open form in design view and go to the events tab of the form
property
sheet. Select [event procedure] from the OnCurrent dropdown list, and
paste the above code into the code window that appears when you click
the [...] code builder button.

--
Clif
Still learning Access 2003


:

Open form in design view and view Tab Order. Arrange tab so that
the
object
you want as first is at top of list.
--
KARL DEWEY
Build a little - Test a little


:

How do I get the cursor to start at the beginning of the form
each
and every
time after going to the next (or another) record?
 
Back
Top