Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here





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.:


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!


Good work!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close