Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning to original application

Status
Not open for further replies.

sha76

Programmer
Sep 2, 2002
5,085
GB
I'm sure this should be a fairly easy one:

I open a new outlook contacts form from access (creating a new instance of outlook). I've got no problems if outlook isn't already running, but if it is then when I close the contacts form my outlook window gets the focus.

How do I get the focus to return to my access form?
I set the variable for the outlook application to nothing after closing the form and I've tried using SetFocus, but although the code runs without an error, it doesn't do anything!

 
I have two suggestions but I don't know if either will work:

1. myForm.focus
2. myForm.select (works in excel)

I hope one will work for you.
 
Thanks, but no, no result from either of those.
 
Just incase anybody else has the same problem; I finally got round it by raising an error after quitting outlook and then handling this error, but not giving it any code!

Very weird, annoyingly untidy, but hey, at least I don't leave my users wondering why they're suddenly staring at their inbox anymore!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top