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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning to my application after going to lotus notes. 1

Status
Not open for further replies.

verizonrep

Programmer
Oct 29, 2002
48
US
Okay.. this should be an easy one but I'm having one of those days. I am running some code that outputs a report through lotus notes. When it is over, lotus notes is what shows on my screen and I'm trying to get it to come back to my application. I tried the "DoCmd.SelectObject "Switchboard", false" thing at the end of my code, but it is not returning to my application.

Any thoughts?

Will
 
Have you tried to play with the AppActivate instruction ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I put in:

AppActiveate "Progress.mdb"


(my application is called PROGRESS). When I did this, I got an error. The application is open, so I'm not sure if I am supposed to input a path. This is a challenge because many people use the front end and they could have it filed in different spots.

Any ideas as to how to use this?
 
And this ?
AppActivate "Microsoft Acces - [Progress"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Did you mean:

AppActivate "Microsoft Acces - [Progress]"

(closed bracket at the end)

 
Read carefully the window's title of your app ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If I go into the properties of my app (currently on the desktop), it says:

PROGRESS CMS.mdb

If I go into the startup, it says:

PROGRESS CMS

If I look at the development area (tables, queries, etc.), it says:

PROGRESS




I also have tried running with:

strCaption = Application.CurrentDb.Properties("PROGRESS.mdb")
AppActivate strCaption


This didn't work either.



 
Read carefully the window's title of your app when it's running
You may simply try this:
AppActivate "Microsoft Access"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I ran that code as well and I'm still getting an error. I did find a way to get it back to my app by doing a sendkey "%{TAB}}" command. Given that it went from PROGRESS to Lotus Notes, the Alt+Tab just brings it right back, but I would much rather call the application by name. When I look at the application, it does read PROGRESS CMS. I tried it and it is still choking on an error.

Talk about frustrating. This thing should work with just the simple AppActivate "Microsoft Access" command, but it isn't working. Hmmmmmm.....


Will

 
This will get you close:

I don't know why Access will come to the foreground again but your form will not have the focus as such. It has to be something about Access which I don't know.


Code:
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long


SetForegroundWindow me.hwnd ' where this is in a form module

or

SetForegroundWindow Application.hWndAccessApp

I don't know why it's hard. AppActivate "Micrsoft Access" works for me in the same way: Access is brought to the foreground but no visible window in Access seems to have the focus...
 
Hmmm...still not working. I am going to get this, even if it kills me.

Thanks for all your help. I think you are steering me in the right direction.


Thanks,


Will
 
That API call is pretty low level (simple as it is). So if that failed to bring your window to the top then another window has used some other API call (which I can't quite recall) to set it's ZOrder to be the topmost. Pretty silly if Notes is the culprit and please post here once you know the answer :)
 
I will. Thanks again for all your help.



I really hate working with Notes....I really do.


Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top