Olá pessoal boa tarde, estou tentando fazer com que ao efetuar uma venda ao clicar em finalizr abre um forme onde me passe apenas as informações dessa ultima venda, mas no meu código ele esta retornando todas as vendas, alguém poderia me ajudar?
Private Sub btnfinalizar_Click(sender As Object, e As EventArgs) Handles btnfinalizar.Click
Dim numero As Integer
con.Open()
sql = "select * from faturas where nfaturas = '" & txtnfatura.Text & "'"
da = New FbDataAdapter(sql, con)
tabela = New DataTable()
da.Fill(tabela)
numero = tabela.Rows.Count
con.Close()
obterultimoregistro()
F_relfaturas.Show()
End Sub
Private Sub obterultimoregistro()
Try
con.Open()
Dim cmd As New FbCommand
cmd.CommandText = "select MAX (nfaturas) from faturas"
cmd.CommandType = CommandType.Text
cmd.Connection = con
da.SelectCommand = cmd
con.Close()
tabela.Clear()
da.Fill(tabela)
Dim nfaturas As String = tabela.Rows.Item(0).Item(0).ToString
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub