I just replaced the SetFocus line in your original code with SendKeys command.
Per your reply to Pascal, I added a multipage control to the form and moved the
other controls onto Page1. Still works every time for me - unless I set the
TabStop property to False for txtStringLineInput.