Results 1 to 3 of 3

Thread: When Pressing Tab (updated)

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    15

    When Pressing Tab (updated)

    I AM TRYING TO CODE A LOOKUP WHEN TAB IS PRESSED BUT THE LOOKUP ONLY OCCURS WHEN FOCUS IS LOST. ANYBODY HAVE ANY IDEAS.

    'RESPOND TO TAB OFF CUSTOMER ID on Order Entry window WHEN IN "ADD" MODE
    If pVal.FormType = 139 And pVal.FormMode = fm_ADD_MODE Then
    Set frm = applic.Forms.Item(FormUID)

    'When tab off of the Item Code ("Item") field and a message box appears.
    If pVal.ItemUID = "38" And pVal.ColUID = "1" Then

    Dim txtCCode As EditText
    Dim sCCode As String
    Dim oMatrix As SAPbouiCOm.Matrix
    Dim oColumns As SAPbouiCOm.Columns
    Dim oColumn As SAPbouiCOm.Column

    '// first, get the form's matrix object
    Set oMatrix = frm.Items.Item("38").Specific
    Set oColumns = oMatrix.Columns

    '// get the matrix columns by the UID
    '// bind items to the DB data source here:
    Set oColumn = oColumns.Item("1")
    Set txtCCode = oColumn.Cells.Item(1).Specific
    sCCode = txtCCode.String

    If IsCustomerQualified(sCCode) = False Then
    Dim ofrm As SAPbouiCOm.Form
    Set ofrm = applic.Forms.Item("frm_" & Str(pApp.Forms.Count))
    rc = applic.MessageBox("The Item does not exist. Please re-enter the item code")
    BubbleEvent = False

    End If
    Last edited by lvquinones; Apr 12th, 2005 at 11:03 AM.

  2. #2
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313

    Re: When Pressing Tab

    Hi.
    Could you possibly post some code, or some more details of what you are trying to achieve. We haven't got much to go on.

    Thanks,

    PP

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: When Pressing Tab (updated)

    Where is this code being run?

    I would suggest using the Validate event of the control (which is fired just before the focus is changed), then instead of "BubbleEvent = False" you can use "Cancel = True" to make sure they cant leave the control until the data is valid.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width