Get the result returned at Do F4

Asked

Viewed 196 times

1

I created a VBA that shows a vendor list and can’t get the selected item 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 we return the selected Item?

1 answer

1


You have to associate a variable with the output of the function. 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
  • It worked! Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.