SeFocus causing Run time error

Posted by code8230 on Stack Overflow See other posts from Stack Overflow or by code8230
Published on 2012-10-26T22:56:41Z Indexed on 2012/10/26 23:00 UTC
Read the original article Hit count: 171

Filed under:

I am getting:
Run-time error '5':
Invalid procedure call or argument

this seems to happen when Text(1).SetFocus is called.

However, I dont see this run time error for all the cases where I have used SetFocus. Just 2-3 places it is causing this error.

Text(1).SelStart = 3
Text(1).SelLength = 1
Text(1).SetFocus

I tried:

Text(1).Enabled = True  
Text(1).Visible = True  

just above .SelStart, but it didn't fix the issue.

© Stack Overflow or respective owner

Related posts about vb5