Thanks Kevin. I fear I am taking up too much of your time, and as you seem to be pretty good at this, your time must be valuable.
The function myHWnd will return a handle to the active form /report / datasheet within Access, so there is no need to hunt for its handle using the FindWindowLike recursion function.
I don't. I get hWnd from hWnd = Access.Application.hWndAccessApp. This works well.
A call to myAppActivate with "Access" for the window title should ensure it is the active foreground program
I don't think that "Access" will work as I have changed the title of the Db to "Contacts ver 14 May 11". The last part of the title changes frequently.
Revert back to a previous version of myAppActivate as the version you posted won't perform properly as the handle returned by the FindWindowLike function isn't used to show the window: hWnd <> hWndArray
I still call 'FindWindowLike' using the array hwndArray(). but only to see if Skype is loaded. Within my version of 'myAppActivate' I use iret = ShowWindow32(hWnd, MinMax). hWnd is passed to 'myAppActivate' when it is called, so I don't need it from 'FindWindowLike'.
Phew that's all confusing. I think I am on the right track as it all works, but I am sure open to suggestions. EG. how to get 'FindWindowLike' to be non-recursive, as I only want to see if the parent window is open.