I have a macro containing a form showing an Accpac UI and when I am logged onto one database works OK, if I am logged in two databases at the same time it shows the Accpac Log-on screen before showing the form/UI and I must create a new session before it continues, otherwise it cannot open the UI. How can I make the UI pick up the session that I am already in?
I did some more testing: the screen I am using is a Project and Job Cost 53B
I noticed that when I have two companies open and I run the macro it asks to log in and after selecting the user name, password and company ID it opens the screen.
At the same time it creates a new session ID in the Accpac sign on manager.
This is a "sticky" session that does not close by itself even when all Accpac windows are close.
This session remember which company I logged on when I tried to run the macro and if I log onto another company and try the macro it does not ask to log in but is uses that "sticky" session.
Therefore, I might be in company A, run the macro, but the UI in the macro is connected to company B
Above testing was done in 5.4 SM with 53B job cost.
However, if I use the macro in a 53 System Manager environment when running the macro with two companies open it brings up the Signon manager asking to select which existing session I want to use (or create a new sign on).
The macro attaches to the selected session and runs OK and when I close all Accpac Windows all sessions disappear from the sign on manager
So what I am trying to accomplish is:
- either replicate the SM53 behavior in 54 and be able to choose an existing session from the sign on manager
or - if I must create a new session have that session disappear from the sign on manager when macro finishes running
I have not posted any code because the above behavior occurs even in the simplest scenario: show form with Accpac screen on it, without any other code.
I appreciate any suggestions you might have.
Thank you.
I did some more testing: the screen I am using is a Project and Job Cost 53B
I noticed that when I have two companies open and I run the macro it asks to log in and after selecting the user name, password and company ID it opens the screen.
At the same time it creates a new session ID in the Accpac sign on manager.
This is a "sticky" session that does not close by itself even when all Accpac windows are close.
This session remember which company I logged on when I tried to run the macro and if I log onto another company and try the macro it does not ask to log in but is uses that "sticky" session.
Therefore, I might be in company A, run the macro, but the UI in the macro is connected to company B
Above testing was done in 5.4 SM with 53B job cost.
However, if I use the macro in a 53 System Manager environment when running the macro with two companies open it brings up the Signon manager asking to select which existing session I want to use (or create a new sign on).
The macro attaches to the selected session and runs OK and when I close all Accpac Windows all sessions disappear from the sign on manager
So what I am trying to accomplish is:
- either replicate the SM53 behavior in 54 and be able to choose an existing session from the sign on manager
or - if I must create a new session have that session disappear from the sign on manager when macro finishes running
I have not posted any code because the above behavior occurs even in the simplest scenario: show form with Accpac screen on it, without any other code.
I appreciate any suggestions you might have.
Thank you.