Jump to content
Fórum Script Brasil
  • 0

Pesquisar no DataGrid e Selecionar a linha


Almarante

Question

Olá Pessoal Preciso de uma ajudinha.

Estou usando o codigo abaixo para pesquisar registros no DataGrid, está funcionado perfeitamente, porem eu preciso que o cursor do DataGrid aponte o registro encontrado ou selecione a primeira linha, para que o registro selecionado seja mostrado nas texbox do form, como faço isso?

Private Sub txtPesquisa_Change()
X = Len(txtPesquisa.text)
AdoPagar.ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & stCaminhoBD
 Filtro = txtPesquisa.text & "%"
AdoPagar.RecordSource = "select * from ContasPagar WHERE  " & cboPesquisa.text & "  Like  '" & Filtro & "'"
AdoPagar.Refresh

Do While AdoPagar.Recordset.EOF = False

AdoPagar.Recordset.MoveNext
Loop
End Sub

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652.1k
×
×
  • Create New...