Set Focus On Form

GarageFlower

Registered User.
Local time
Today, 20:20
Joined
May 20, 2004
Messages
108
I have a form, and when it opens it has focus on a box i dont want it to focus on

How do i change which box it has focus on when it is opened?
 
Focus

In the On Open Event of the form put:

Me.thisbox.setfocus
 
Nice one.. Thank you

That worked a treat, however have discovered all is not fixed

Its a combo box i wanted to set the focus on which i have done thanks to your advice. But the combo box does not display the any value, it is just blank. How do i get it show the first of the values from the drop down box contained within the combo box?
 
MyCBO.Value = MyCBO.ItemData(0)

This will set the combobox to the first item on the list. If the combobox is empty, though, it will return an error. Always make sure you have items present or code for the possiblity that it can be empty at times.
 

Users who are viewing this thread

Back
Top Bottom