Boa tarde! Poderiam me ajudar, por favor?
Estou com problemas no código abaixo para pular linha após um select. Acredito que esteja puxando um resultado como texto e não como grade, mas há a possibilidade de pular linha após cada item?
Dim aConnection As New ADODB.Connection
Dim aRecSet As New ADODB.Recordset
Private Sub ADD_Click()
Dim sql As String
sql = "delete from pdv_fiscal where numseqini = '" & txtFilter.Text & "' and pdv = '" & txtPDV.Text & "' and TIPO = 'A' and data = '" & CVDate(txtData.Text) & "'"
End Sub
Private Sub GO_Click()
ShowOut
End Sub
Private Sub Form_Load()
aConnection.Open 'conexão ok
End Sub
Private Sub Form_Unload(Cancel As Integer)
aConnection.Close
End Sub
Sub ShowOut()
Dim i As Long, Out As String
If txtFilter.Text = "" Then
aRecSet.Open "Select * from tbl_gererica where pdv = 0", aConnection, adOpenKeyset
MsgBox "Preencha os campos Data, PDV e Sequência", vbInformation, "Erro"
Else
aRecSet.Open "Select * from tbl_gererica where numseqini = '" & txtFilter.Text & "' and pdv = '" & txtPDV.Text & "' and data = '" & CVDate(txtData.Text) & "'", aConnection, adOpenKeyset
End If
txtOut.Text = ""
For i = 1 To aRecSet.RecordCount
Out = Out & " Data: " & aRecSet.Fields("Data").Value
Out = Out & " Sequência: " & aRecSet.Fields("numseqini").Value
Out = Out & " PDV: " & aRecSet.Fields("pdv").Value & vbCrLf
aRecSet.MoveNext
Next i
txtOut.Text = Out
aRecSet.Close
End Sub