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

Global Vars 2

Status
Not open for further replies.

mejiaks

IS-IT--Management
Jun 9, 2003
131
HN
does accpac handles global Vars where stores current company info perhaps? How do I access those vars to pass it to my new programs or reports as parameters?
 
Add CMPNAME as a parameter in your Crystal Report and use it, Accpac always passes the company name to CMPNAME.
You can also look at AccpacSession.CompanyID as tuba says.
 
sorry if this seems dumb to you all, but, let's say I build a exe to run inside Accpac the I add this exe on the accpac environment using

right click/New/program

on the program arguments should i pass either CMPNAME.
or AccpacSession.CompanyID and crystal will recieve the current company ID?
 
If your executable has a reference to the COMAPI, and you initialize a Session object and login to Accpac, then you'll get the CompanyID. There are no arguments to pass.
 
I am not really sure what you mean. I donot know what comapi is, neither initializing a session object???????

this is what I did, I made an app with Visual Foxpro, compile it to an exe file, then inside the accpac application I add a new item to the order entry, specifically to the report menu,

new/program

then i reference my exe so my exe runs inside accpac

so, based on that , could you be so kind and elaborate for this accpacc newbie?
 
Oh, you mean a simple non-COMAPI executable? There's nothing to pass, Accpac doesn't work that way. You might be try gleaning the current company from HKEY_CURRENT_USER\Software\ACCPAC INTERNATIONAL, INC.\ACCPAC\DESKTOP\Company, and the user from HKEY_CURRENT_USER\Software\ACCPAC INTERNATIONAL, INC.\ACCPAC\DESKTOP\User.
 
There is a lot of legwork to do to get an app written the way you are to seamlessly integrate with Accpac, this is way beyond discussing in a forum like this. Either deal with the integration issues in your app as tube suggested, or use VBA and you do not have the integration issues.
Why do you need to use VFP (of all the options out there) and compile an exe?
 
Thnks Tuba2007. This registry stuff helped me to achive what i was looking 4.

additional question: what if ACCPAC is ran twice on the same computer? I noticed it changes the info, so the last logging prevails? is the last login the one recorded on the registry?

 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top