Get the result returned when doing F4

3

I created a VBA that shows a list of vendors and I can not get the item selected after F4.

Public Sub ListaFornecedores()
    Dim strSql As StdBEStringBuilder

    Set strSql = New StdBEStringBuilder

    strSql.Append ("SELECT Fornecedor, Nome FROM Fornecedores")
    PSO.Listas.GetF4SQL "Fornecedores", strSql.Value, "Fornecedor, Nome"

End Sub

Does anyone know how to return the selected item?

    
asked by anonymous 09.08.2018 / 18:12

1 answer

6

You need to associate a variable with the function result. In this case you will return the Name and Provider separated by space.

Public Sub ListaFornecedores()
    Dim strSql As StdBEStringBuilder
    Dim strResultado as String

    Set strSql = New StdBEStringBuilder

    strSql.Append ("SELECT Fornecedor, Nome FROM Fornecedores")
    strResultado = PSO.Listas.GetF4SQL("Fornecedores", strSql.Value, "Fornecedor, Nome")

End Sub
    
09.08.2018 / 19:12