Go to a specific controll when open a Form

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi all again and thanks for all great support i received at this place!

When opening a form i wish to go to a specific controll (in this case a
unbounded combox in the form header)...is this an event in the On Open...or?

Ciao!
 
On Open is fine, but if your form is used to display and move through several
records and you want to go to this control everytime you change record, then
On Current event is better.

[ComboBoxName].SetFocus
 
Thanks, you make a good point there. Will try that one too.

RonaldoOneNil said:
On Open is fine, but if your form is used to display and move through several
records and you want to go to this control everytime you change record, then
On Current event is better.

[ComboBoxName].SetFocus

Peter said:
Hi all again and thanks for all great support i received at this place!

When opening a form i wish to go to a specific controll (in this case a
unbounded combox in the form header)...is this an event in the On Open...or?

Ciao!
 
Open event of a form is not a good place to put code to set focus to a
specific control. Controls usually are not instantiated yet during the Open
event.

I usually use Load event, and make the SetFocus step the last step in the
code procedure.

As noted elsethread, Current event also is useful if you want to do the
SetFocus each time you move from one record to another.
 
Back
Top