Open Form - Curser in first Header field.

jomuir

Registered User.
Local time
Today, 20:30
Joined
Feb 13, 2007
Messages
154
When I open a form is there a way of specifying which field is highlighted first?

These are search forms with unbound fields in the Header, and the results in the are in the details section (fields and subforms). Whenever a form is opened, the data in the first field of the details section is always highlighted (this is also the first in the tabbed order in the details section). Ideally I would like the curser to be sitting in the first field in the Header area (this is also the first in the tabbed order in the Header section).
 
I think you can do this with the tab features -?

Eidt - Or maybe setfocus in the on open event?
 
I have the fields in the tab order I want, but you select the tab order for the 3 different sections, Header, Details & footer. Whenever a form opens it goes to the the first tab order in the Details section.

I ideally would like it to go to the first tab in the Header section, but do not know if this is possible?
 
Thank you,

This did it......I added this to my open clear search data sub:-

Private Sub Form_Open(Cancel As Integer)
clearform
Me.txtRatesRef.SetFocus
End Sub

Thanks!!
 
Maybe this is overkill, but you can use VBA to do it.

In design mode go to the properties of the whole form. Go to the events tab, click the dots next to "on load". Select CODE.

In that window, type the name of the field then . then setfocus. Like this:

searchfield.setfocus

Edit: I took way to long to type that...
 

Users who are viewing this thread

Back
Top Bottom