Activating a Control in the Header

  • Thread starter Thread starter PosseJohn
  • Start date Start date
P

PosseJohn

I'm using ACC2007.

I have a form "frmContacts", which I need to setfocus to a control
"datStoreName" in the FORM HEADER when it first opens.

I have tried the following...

Private Sub Form_Open (Cancel as Integer)
Me.datStoreName.SetFocus
End Sub

....but the first control in the DETAIL section retains focus when the form
opens.

How do I refer to a control in the FORM HEADER?

Thanks everyone...
 
John, I've found this to be flaky as well.

You may have more success with the Load event than Open, but if the form is
complex and there is code in other events, it still may not work.

At very least, you could provide a hotkey for jumping to the control in the
form header. Include an ampersand in the Caption of the label attached to
this control. This example jumps there with Alt+S:
&Store Name
 
Maybe you have to also set focus to the header section, as well as the
desired control in that section?
 
Allen Browne said:
How do you do that, Paul?
Sorry, I thought I remembered having done that, but you're right of course.
There is no focus method for a form section.
 
Back
Top