SetFocus problem

  • Thread starter Thread starter jason.evans
  • Start date Start date
J

jason.evans

Hi folks

I have the following code

If Me.Parent.NewRecord Then
Me.Parent.txtFolderStart.SetFocus
Me.Parent.txtFolderStart.SelStart = 0
Exit Sub
End If

When I step through this I can see the focus go to the control and the
cursor move to the start of the textbox. However, once the Exit Sub
line is run, the focus moves from the text box I have assigned it to,
to the next control which is another text box.

Any ideas greatly appreciated.
 
What's the Exit Sub doing in there? Does it work without it? Could you give
us the rest of the code so that we can see what's in the subroutine?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top