Description: Error occurred when activating Sage 300 Data Source.

I have a program that was written a while back.  Specifically it uses the AP Invoice Entry screen and does some things in the background when they enter an invoice.  All is well unless they close the screen, re-open the screen, and then they navigate to another entry.  When they do that they get this error:

  Description: Error occurred when activating Sage 300 Data Source.

Code: 1.399

Source: 10:32:19 - DS.adsAPOFD

Any ideas on how I can fix this problem?  This does not happen using the AP Invoice Entry screen on the main desktop so it is definitely the VB6 program that is not handling something correctly.

Thank you!

  • 0

    Depending on how the screen has been opened within the VB6 app, you might need a short delay added before accessing the underlying data sources.

  • 0 in reply to Django

    I will look in to that.  This is how we are opening the form:

    If strCtlName = "btnOpen" Then
    pStatus = STATUS_CANCEL
    batch_no = AccpacAP2000UICtrl1.UIAppControls("fldAPIBC_cntbtch").Value
    APARInvoiceEntry.Show vbModal
    AccpacAP2000UICtrl1.SetFocus
    AccpacAP2000UICtrl1.UIAppControls("btnRefresh").SetFocus
    SendKeys "{enter}"
    End If

    If strCtlName = "btnNew" Then
    pStatus = STATUS_CANCEL
    batch_no = ""
    APARInvoiceEntry.Show vbModal
    AccpacAP2000UICtrl1.SetFocus
    AccpacAP2000UICtrl1.UIAppControls("btnRefresh").SetFocus
    SendKeys "{enter}"
    End If

  • 0 in reply to LeShel Rich

    Yes - when you're running the screens like that you'll need to give the screen time to do what it needs to do so you'll likely need to put in a short delay.

    I have code in one of my projects that looks like this:

        While AccpacUI Is Nothing
            Sleep 25
            DoEvents
        Wend