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!

open finder with macro 1

Status
Not open for further replies.

johnhugh

Technical User
Mar 24, 2010
702
SG
Hi,

Is it possible to open the OE orders finder from a form within a macro in Accpac 5.5?
 
Yes, add AccpacDataSrc and AccpacFldEdit controls, and put this in the UserForm.Inialize section:

With Me.adsOrderFrom
If Not .Active Then
.DBLinkCompany = a4wlinkRead
.Active = True
End If
End With

Me.fldOrderFrom.DataSource = Me.adsOrderFrom

Look at the sample macros from Accpac for more details.
 
Ok, so in order to get the OE finder I need to show the whole OE Order Entry UI on my form.
That's obviously nonsense. I'll create a drop-down list then instead.
Thanks for your help.
 
What's nonsense? I never said show the whole UI. You drop the field edit and data source controls on your form, then go from there.

Maybe you should leave programming to the professionals.
 
Create a VBA macro and add Accpac Finder 1.0 under Tools, References.
This is an example to load an item finder, but you can adapt it to any other Accpac view.
Add a textbox named txtItem and a label named lblDesc.
Add a command button and add the following code to the button:
Code:
    Dim fnd As AccpacFinder.ViewFinder
    Set fnd = New AccpacFinder.ViewFinder
    fnd.Session = AccpacSession
            
    fnd.ViewID = "IC0310"
    fnd.DisplayFieldIDs = Array(1, 7, 3, 5) 'Get the field IDs from the AOM
    fnd.ReturnFieldIDs = Array(7, 3)
    'fnd.Filter = ""
    fnd.InitKeyType = USER_PASSING_INIT_KEY
    fnd.InitKeyValue = txtItem.Text
    
    fnd.AutoTabAway = False

    If fnd.Finder = True Then
        txtItem.SetFocus
        txtItem.Text = fnd.ReturnFieldValues(0)
        lblDesc.Caption = " " & fnd.ReturnFieldValues(1)
    End If
 
Brilliant.
Thanks ettienne. That helped a lot. I understand now how it works.
 
ettienne,

Does this approach work in version 6.0?

I did the same on version 5.6. Sometimes it returns more fields than the regular Accpac finder, which is okay.

Thanks,
 
Yes it works in 6.0
You can add or remove fields as required, if you do not specify any display fields then it returns all fields. Note that the more fields you display the slower the finder becomes.
 
Just curious...

All the Accpac integrated programs\macros will required Accpac to be installed on the client machine. That means the users can access Accpac and can use the Accpac modules\apps. (unless it is run by scheduler.)

Why there is a need for programs tightly integrated with Accpac by using Accpac's system objects, like finder, system manager, customized OE... etc. Can't the users just perform a few clicks to access Accpac screen and get the info.? A lot of the time, Accpac info. can be accessed from the desktop. Why created something custom?

I do see the need for the remote users who need to access Accpac data from an external app. e.g. a Web application that needs to verify the vendor info. In this case, the Accpac components will not be sufficient to do the job anyway.

I guess I am looking for on an architecture level, do we need to really need to take into consideration of the Accpac Components? and is there any advantages ?

 
It all depends on what the customer wants.
If you are only reading data then certainly you can pull data from the database and not use any Accpac objects. If you are writing data to Accpac then you absolutely must use Accpac objects to maintain data integrity.
A lot of the custom apps include modifications to Accpac data entry screens in order to add some extra functionality or data manipulation or data validation.
 
If you're just verifying data, i.e., one-way read only, just use simple SQL calls.
 
Thanks for the replies. That validated my thoughts in system architecture side.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top