PULAR LINHA NO FLEXGRID VB6
tente então
Dim IdAnterior As String
RS.Open [Ô]SELECT * from Tabela1 where cdate(C12) >= cdate([ô][Ô] & BDat_Ini & [Ô][ô]) And cdate(C12) <= cdate([ô][Ô] & BDat_Fin & [Ô][ô]) order by C0, C2 asc[Ô], CON, adOpenStatic, adLockOptimistic
Do While Not RS.EOF
Grid1.TextMatrix(Grid1.Rows - 1, 1) = RS.Fields(0).Value: Grid1.TextMatrix(Grid1.Rows - 1, 2) = RS.Fields(1).Value
Grid1.TextMatrix(Grid1.Rows - 1, 3) = RS.Fields(2).Value: Grid1.TextMatrix(Grid1.Rows - 1, 4) = RS.Fields(3).Value
Grid1.TextMatrix(Grid1.Rows - 1, 5) = RS.Fields(4).Value: Grid1.TextMatrix(Grid1.Rows - 1, 6) = RS.Fields(5).Value
If RS.Fields(0).Value <> IdAnterior Then
IdAnterior = CStr(RS.Fields(0).Value)
Grid1.Rows = Grid1.Rows + 2
Else
Grid1.Rows = Grid1.Rows + 1
End If
RS.MoveNext
Loop
Grid1.Rows = Grid1.Rows - 1
Mesmo problema, igual na imagem.
Caramba, conseguiiiiiiiiiii. Segue o código.
Dim IdAnterior As Integer
RS.Open [Ô]SELECT * from Tabela1 where cdate(C12) Between cdate([ô][Ô] & BDat_Ini & [Ô][ô]) And cdate([ô][Ô] & BDat_Fin & [Ô][ô]) order by C0, C8 asc[Ô], CON, adOpenStatic, adLockOptimistic
Do While Not RS.EOF
If RS.Fields(0) <> IdAnterior Then
IdAnterior = CInt(RS.Fields(0))
Grid1.Rows = Grid1.Rows + 1
End If
Grid1.TextMatrix(Grid1.Rows - 1, 1) = RS.Fields(0).Value: Grid1.TextMatrix(Grid1.Rows - 1, 2) = RS.Fields(1).Value
Grid1.TextMatrix(Grid1.Rows - 1, 3) = RS.Fields(2).Value: Grid1.TextMatrix(Grid1.Rows - 1, 4) = RS.Fields(3).Value
Grid1.TextMatrix(Grid1.Rows - 1, 5) = RS.Fields(4).Value: Grid1.TextMatrix(Grid1.Rows - 1, 6) = RS.Fields(5).Value
Grid1.Rows = Grid1.Rows + 1
RS.MoveNext
Loop
Grid1.Rows = Grid1.Rows - 1
Muito obrigado mesmo FILMAN e MARCELO-TREZE, me ajudaram muito.
Dim IdAnterior As Integer
RS.Open [Ô]SELECT * from Tabela1 where cdate(C12) Between cdate([ô][Ô] & BDat_Ini & [Ô][ô]) And cdate([ô][Ô] & BDat_Fin & [Ô][ô]) order by C0, C8 asc[Ô], CON, adOpenStatic, adLockOptimistic
Do While Not RS.EOF
If RS.Fields(0) <> IdAnterior Then
IdAnterior = CInt(RS.Fields(0))
Grid1.Rows = Grid1.Rows + 1
End If
Grid1.TextMatrix(Grid1.Rows - 1, 1) = RS.Fields(0).Value: Grid1.TextMatrix(Grid1.Rows - 1, 2) = RS.Fields(1).Value
Grid1.TextMatrix(Grid1.Rows - 1, 3) = RS.Fields(2).Value: Grid1.TextMatrix(Grid1.Rows - 1, 4) = RS.Fields(3).Value
Grid1.TextMatrix(Grid1.Rows - 1, 5) = RS.Fields(4).Value: Grid1.TextMatrix(Grid1.Rows - 1, 6) = RS.Fields(5).Value
Grid1.Rows = Grid1.Rows + 1
RS.MoveNext
Loop
Grid1.Rows = Grid1.Rows - 1
Muito obrigado mesmo FILMAN e MARCELO-TREZE, me ajudaram muito.
Tópico encerrado , respostas não são mais permitidas