Skip to Content
author's profile photo
Former Member

Click Event Question - VB6 SDK 6.5

A quick question for you guys:

On the A/R Invoice form, I have a UDF that exists as a combo box. I can trap the et_COMBO_SELECT event on that combo box just fine, however, I would like to generate a click event on the 'Name' field on the main form from the UDF et_COMBO_SELECT event. The problem I'm running into is that because the form that contains the UDF has a different UID from the actual A/R Invoice main form, I get an error when I try to perform the click event on the 'Name' field. The code I'm using is below. Any help would be appreciated.

Thanks,

Greg

'(A/R Invoice) Change value of eqp_DivisionCode global variable when combo select event triggers

If eqp_pVal.FormType = -133 And eqp_pVal.FormMode = fm_ADD_MODE And _

eqp_pVal.ItemUID = "U_Division" And eqp_pVal.EventType = et_COMBO_SELECT Then

Set eqp_frm = SBO_Application.Forms.Item(FormUID)

Set eqp_cmbDivision = eqp_frm.Items("U_Division").Specific

eqp_DivisionCode = eqp_cmbDivision.Selected.Value

End If

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Jul 07, 2004 at 07:32 AM

    Hi Greg,

    if you want to access a User Defined Field on a System Form but in header level you need to approach it as follows:

    If (pVal.EventType = et_FORM_LOAD And pVal.FormType = 139 And _

    pVal.Before_Action = True) Then

    Set oform = m_App.Forms.Item(FormUID)

    Dim oUsrForm As SAPbouiCOM.Form

    Dim num As Long

    Dim UDFformUID As String

    num = Right(FormUID, (Len(FormUID) - 2))

    num = num + 1

    UDFformUID = "F_" & num

    Set oform = m_App.Forms.Item(UDFformUID)

    oform.Items.Item("U_1").Specific.String = "Test"

    End If

    Regards,

    Lisa Mulchinock

    SAP SDK Consultant

    Galway

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks very much for your response. My issue is resolved.

      I was actually trying to go the other way around, meaning I wanted to access a system form from a UDF. Using the formula for the formUID you gave me I was able to do it. For those that may run into the same problem, the code would look something like this:

      If (pVal.EventType = et_FORM_LOAD And pVal.FormType = -139 And _

      pVal.Before_Action = True) Then

      Set oform = m_App.Forms.Item(FormUID)

      Dim oUsrForm As SAPbouiCOM.Form

      Dim num As Long

      Dim SYSformUID As String

      num = Right(FormUID, (Len(FormUID) - 2))

      num = num - 1

      SYSformUID = "F_" & num

      Set oform = m_App.Forms.Item(SYSformUID)

      oform.Items.Item("54").Specific.String = "Test"

      End If