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!

Accpac Signon UserID

Status
Not open for further replies.

irenavassilia

Programmer
Jun 19, 2007
101
Hi Everyone,

I am creating a function that gets the Accpac User ID.
I cant seem to get it work properly, I am very new to VBA Accpac programming so I'm not sure if its my code that wrong or something else because I dont get any errors:

Here is my code, any help will be greatly appreaciated:

Private Sub Form_Load()
Dim Session As New AccpacSession
Dim SignOn As New AccpacSignonMgr
Dim mSessionMgr As New AccpacSessionManager.AccpacSessionMgr
Dim UserID As String

Set mSessionMgr = New AccpacSessionManager.AccpacSessionMgr
Set Session = New AccpacSession

With mSessionMgr
.ForceNewSignon = False
UserID = Session.UserID
End With

End Sub

The UserId is always null.

Regards,

Irena
 
Right cause its on form load, but even if i put it into a function after i have signed on it still gives me the null value.
 
Try setting your data link, then get it from mdbLinkCMPRW.Session.Userid,
 
This code works for anyone that ever wants to get the UserID
Private Sub Form_Load()
Dim Session As New AccpacSession
Dim Signon As New AccpacSignonMgr
Dim dbCmp As AccpacDBLink
Dim UserID As String
Dim vComp As AccpacView

Session.Init "", "PO", "PO1210", "53B"
UserID = Signon.Signon(Session)

UserID = Session.UserID

End Sub

Regards,

Irena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top