MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Forms: Changing focus to an object using AfterUpdate

Posted by Rob G on April 05, 2001 7:04 AM

I am trying to set focus to a certain object on my form which is not the next item in the tab order. I am using the AfterUpdate event, and it doesn't seem to be working.
What is a good way of ensuring that the focus gets transferred to the item of choice, even when using AfterUpdate.
I understand that when the AfterUpdate event is complete, it automatically sets focus to the next item in the list.

Posted by Dave Hawley on April 05, 2001 4:58 PM

Hi George

Try the Exit event. But I'm a bit confused as why not just change the Tab Index ?

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
End Sub

This will skip the next control in the Tab order and go straight to TextBox3

OzGrid Business Applications