I am launching picture and fax viewer using the shell command. My VB app loses focus when this happens, so I use the following commands to regain focus:
This works only when I delay the code by placing a msgbox("") before the AppActivate function. It appears that picture and fax viewer is stealing focus AFTER my commands execute. The msgbox delays the execution enough, so that by the time I click OK, the focus is correct. I do not even need the AppActivate command, just Me.txtMyTextBox.Focus() works.