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

ACCPAC Controls 1

Status
Not open for further replies.

Simboti1

IS-IT--Management
Sep 12, 2008
31
BW
Is it possible to make use of the following ACCPAC controls in VB6/XAPI environment: -
1. Period Picker Control?
2. ACCPAC Finder to search and filter specific GL Code?

If and of the above is possible please provide sample code for:
1. Trapping the selected Fiscal Period and Year into some variable.
2. Trapping the selected GL account Code
 
Yes to both - you can use any Accpac control in VB6.

I don't have a sample for the period picker since I don't use it, but here is one for the finder. Add a reference to Accpac Finder 1.0 in VB6, then add a button to the form as well as a text box and a label. You can get the names from the code sample.

Code:
Private Sub cmdFind_Click()
'   Add a reference to ACCPAC Finder 1.0 in Tools, References
    
    Dim fnd As AccpacFinder.ViewFinder
    Set fnd = New AccpacFinder.ViewFinder
    fnd.Session = AccpacSession
            
    fnd.ViewID = "GL0001"
    fnd.DisplayFieldIDs = Array(1, 3, 4, 6) 'Get the field IDs from the AOM
    fnd.ReturnFieldIDs = Array(1, 3)
    'fnd.Filter = "" 'Can be used to filter the records
    fnd.InitKeyType = USER_PASSING_INIT_KEY
    fnd.InitKeyValue = txtAccount.Text
    
    fnd.AutoTabAway = False

    If fnd.Finder = True Then
        txtAccount.SetFocus
        txtAccount.Text = fnd.ReturnFieldValues(0)
        lblDesc.Caption = " " & fnd.ReturnFieldValues(1)
    End If

End Sub

There are other ways to do this as well, you could add a field edit control (fec) to your form and use the finder from there, it all depends on your preferences.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top