Public RS As ADODB.Recordset
Private Sub cmd_print_Click()
Printer.PaintPicture picRel.Image, 0, 0, picRel.Width, picRel.Height
Printer.EndDoc
End Sub
Private Sub cmd_sair_Click()
Unload Me
End Sub
Private Sub Form_Load()
Call SelecionaRegistro
'If Erro = True Then
' Unload Me
'Else
Call CriaPedido
'End If
End Sub
Private Sub SelecionaRegistro()
Dim SQL As String
'Dim Criterio As String
Set RS = New ADODB.Recordset
RS.Open "CadCaixas", CnSql, 1, 3
'Criterio = Chr$(39) & CaixaID & "%" & Chr(39)
SQL = "Select * From CadCaixas Where Emissao Between '" & Format(txtInicial, "DD/MM/YYYY") & "' AND '" & Format(txtFinal, "DD/MM/YYYY") & "'"
'SQL = "SELECT CaixaID, Descricao, Emissao, Doc, Credito, Debito, Saldo FROM CadCaixas WHERE CadCaixas.Emissao Like " & Criterio & " ORDER BY CaixaID"
FrmListaExtratos.FG1.TextMatrix(0, 0) = RS!CaixaID
FrmListaExtratos.FG1.TextMatrix(0, 1) = RS!Emissao
FrmListaExtratos.FG1.TextMatrix(0, 2) = RS!Descricao
FrmListaExtratos.FG1.TextMatrix(0, 3) = RS!Doc
FrmListaExtratos.FG1.TextMatrix(0, 4) = RS!Debito
FrmListaExtratos.FG1.TextMatrix(0, 5) = RS!Credito
'FG1.TextMatrix(0, 6) = "Saldo R$:"
End Sub
Private Sub CriaPedido()
'-----------------------
'Incinio do Extrato
'-----------------------
picRel.FontBold = False
picRel.FontName = "MS Sans Serif"
picRel.FontBold = True
picRel.FontSize = "9"
picRel.CurrentX = 80
picRel.Line ((picRel.ScaleWidth - 220), 600)-(250, 620), , BF
picRel.Print Tab(5); ""
picRel.Print Tab(50); "E X T R A T O D O C A I X A"
picRel.FontBold = False
picRel.Print Tab(4); String(230, "-")
picRel.Print Tab(4); "Item Descriçao Lançamento Documento Débitos Créditos Saldo"
picRel.Print Tab(4); String(230, "-")
With RS
Do Until .EOF = True
picRel.FontName = "MS Sans Serif"
picRel.Print Tab(4); !CaixaID;
picRel.Print Tab(10); !Descricao;
picRel.Print Tab(50); !Emissao;
picRel.Print Tab(70); !Doc;
picRel.Print Tab(90); !Debito;
picRel.Print Tab(110); !Credito;
'esp = 12 - Len(Format(!Debito, "###,###,##0.00"))
'picRel.Print Tab(80); Space(esp); Format(!Debito, "###,###,##0.00")
'esp = 12 - Len(Format(!Credito, "###,###,##0.00"))
'picRel.Print Tab(100); Space(esp); Format(!Credito, "###,###,##0.00")
esp = 12 - Len(Format(!Saldo, "###,###,##0.00"))
picRel.Print Tab(130); Space(esp); Format(!Saldo, "###,###,##0.00")
' picRel.FontName = "Symbol"
' picRel.Print Tab(3); String(69, "¾")
picRel.FontName = "MS Sans Serif"
.MoveNext
Loop
End With
' picRel.Print Tab(84); String(27, "=")
' picRel.Print Tab(84); "Valor Total"; Tab(97); Format(SamaTudo, "#,##0.00")
' picRel.Print Tab(84); String(27, "=")
'
'-------------------------------
'Rodapé
'-------------------------------
' picRel.Line ((picRel.ScaleWidth - 300), (picRel.ScaleHeight - 1070))-(220, (picRel.ScaleHeight - 1100)), 15, B
' picRel.CurrentY = (picRel.ScaleHeight - 1150)
' picRel.Print Tab(3); "Projeto: Eidtando diretamente no Grid by Daniel de Moura ->
programador.infotec@gmai.com"
' picRel.Line ((picRel.ScaleWidth - 300), (picRel.ScaleHeight - 630))-(220, (picRel.ScaleHeight - 660)), 15, B
End Sub
Private Sub hBar_Change()
picRel.Left = -hBar.Value + 255
picFundo.Cls
End Sub
Private Sub vBar_Change()
picRel.Top = -vBar.Value + 255
picFundo.Cls
End Sub