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

Help with Basic - AR UI

Status
Not open for further replies.

basquiat

Technical User
Jun 1, 2005
22
ZA
Hi I am new to ACCPAC and have a bit of VB knowledge.
I'm using ACCPAC v5.3A
As a start all I want to do is:
1) connect to the Demo company
2) Create a AR UI
3) populate a Combo Box with the AR ID's
4) Have a text box where the Group ID of the AR, selected in combo box, is displayed.

So far this is what I have...

Public Sub Form_Activate()

' COMAPI Session and DBLink object
Dim Session As New AccpacCOMAPI.AccpacSession
Dim DBLink As AccpacCOMAPI.AccpacDBLink

' Open the ACCPAC Session
Session.Open "ADMIN", "ADMIN", "SAMINC", Date, 0, ""
Session.Init "", "AR", "AR0024", "52A"

' Set the DBLink object for the fields
Set DBLink = Session.OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)

'Declare and Open the View
Dim ARACCOUNT As AccpacView

Any help would be greatly appreciated!

 
Instead, add a Field Edit control and a Data Source control to the form, then link them like this:

With Me.adsGroup
If .Active = False Then
.DBLinkCompany = mDBLinkCmpRW
.Active = True
End If
End With

Me.fldGroup.DataSource = Me.adsGroup


Jay Converse
IT Director
Systemlink, Inc.
 
Thanks for the response Jay

I've added the Field Edit Control and Data Source control components.

But I am not sure how to connect the Data Control to SAMINC.
The code you gave, is that to be saved under AccpacDataSource1_OnActivate?

Please take a look at my connection code...are you happy with that?;

Sorry for all the questions, I really still trying to feel my way around;

Thanks in advance for your help;
 
Just put that code in the UserForm Initialize.

Jay Converse
IT Director
Systemlink, Inc.
 
Jay, I am getting "compile error: Method or data member not found" on adsGroup.

Any idea why?

Thanks
 
That's the name of the data source control on the form, yours must be different.

Jay Converse
IT Director
Systemlink, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top