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

ACCPACAP1500UICtrl 1

Status
Not open for further replies.

ajwonder

Programmer
Aug 23, 2011
35
ZA
Hi All,

I am trying my best to read the selected "document number" and "Document Type" from the Transactions tab of the AP Vendor activity screen (AP1500). The UI Info does not reflect the fields/parameters passed to open the cmdPopForm1 when you double click on the document number, or click on the Open button...

With Me.ACCPACAP1500UICtrl0
Me.SelDocVal = .UIAppControls("afecAPDOCSvalue").Value
End With

The above code reads the starting value from the UI, but there might be more than one record in the list and I would like to record what record was selected to open the Document Information screen.

Thank you in advance...

 
Create a variable to connect to the datasource that's populating the grid. That should then point to the record that the user has drilled into.
 
Hi DjangMan,

Thank you for your reply. Do appreciate, but I need further assistance, please...

Using the BeforeCtlClick event of the ACCPACAP1500UICtrl, I could determine that the cmdPopForm1 control is called and that the OnPopupOpened event procedure is then executed, to call the AP1500PFrmDSPopup1 form, but I could not connect to the datasource that populate the screen and not isolate the IDINVC field/value refelcted in the APOBL/APOBS tables of the selected record.

Can you please assist with sample code?

(300 Premium - 2018)
 
Using the UI info tool you can see the datasources an UI controls that you can interact with.

Your code will be something like (I'm writing this without doing it in VB):

dim withevents DocumentDS and AccpacDataSource

In your _UIOpen event for the UI:

set DocumentDS = ACCPACAP1500UICtrl0.GetDSControl("adsAPDOCS")

Now you can look at the fields of the current record that the datasource is pointing at. e.g.:

DocumentDS.Fields("IDINVC").value

There's also adsAPIBH and adsAPOBL - I'm not certain of which datasource you need to connect to.
 
Hi DjangMan,

Got it working on the AP side. I had to reference the control when I declared the WithEvents and reference the index number of the adsAPDOCS instead of using the name:

Option Compare Database
Option Explicit
Dim WithEvents DocumentDS As AccpacAP1500.ACCPACDSControl

Private Sub ACCPACAP1500UICtrl0_BeforeCtlClick(ByVal strFormName As String, ByVal strCtlName As String, pStatus As Long)
Dim RecEntry As Integer

Set DocumentDS = ACCPACAP1500UICtrl0.UIDSControls(3)
Me.SelDocVal = DocumentDS.Fields("IDINVC").Value

End Sub


To register the Vendor ID, I included the Updated sub, using the UI Info to determine the correct control:

Private Sub ACCPACAP1500UICtrl0_Updated(Code As Integer)
With Me.ACCPACAP1500UICtrl0
Me.VendorID = Trim(.UIAppControls("afecAPVENvendorid").Value)
End With
End Sub


I am trying to do the same on the AR side, but I do not find the Customer No. control in the UI Info of AR1700 and the form does not like the declaration of the WithEvents. The idea is to capture the IDCUST and the IDINVC when the Ducument number is selected on the documents tab of the AR Customer Enquiery (AR1700)...

(300 Premium - 2018)
 
Got it working!

The missing reference for the Customer ID that is not referenced in the UI Info, is afecARCUSidcust

Then, the event on the tabs moved from the BeforeCtlClick event procedure used in AP to OnLaunchObject on the AR event procedure.

Thank you for your assistance, DjangMan!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top