Member baru? Bingung? Perlu bantuan? Silakan baca panduan singkat untuk ikut berdiskusi.

Welcome to Forum Sains Indonesia. Please login or sign up.

Desember 07, 2024, 02:28:01 AM

Login with username, password and session length

Topik Baru

Artikel Sains

Anggota
Stats
  • Total Tulisan: 139,653
  • Total Topik: 10,405
  • Online today: 47
  • Online ever: 1,582
  • (Desember 22, 2022, 06:39:12 AM)
Pengguna Online
Users: 0
Guests: 57
Total: 57

Aku Cinta ForSa

ForSa on FB ForSa on Twitter

mohon pencerahan para profesional VB

Dimulai oleh b3b3nz, April 29, 2016, 09:50:42 AM

« sebelumnya - berikutnya »

0 Anggota dan 1 Pengunjung sedang melihat topik ini.

b3b3nz

saya baru belajar vb6, saya sedang mencoba membuat program dan semua lancar tetapi saat coba print selalu tidak bisa mohon pencerahan dari para profesional visual basic (saya menggunakan printer Epson TM-U220 USB)
ini source code nya:

Public Sub cetakmanual()
' On Error GoTo peringatanprinter
Dim deret As Integer
Dim vnota As String
Dim vsubtotal As Double
saring = "parameters vnota string;select * from qjual where trim(notajual)=trim(vnota)"
Set tds = dtbs.CreateQueryDef("", saring)
tds.Parameters![vnota] = Text1.Text
Set tbs = tds.OpenRecordset()
vsubtotal = 0
vjmlbarang = 0
If tbs.RecordCount > 0 Then
    tbs.MoveFirst
    deret = 1
    Do While tbs.EOF = False
       If deret = 1 Then
        Open "Lpt1" For Output As #1
          Print #1, Chr(27) & Chr(33) & Chr(1)
          Printer.CurrentX = (1 * 567)
          Printer.CurrentY = (1 * 567)
          Print #1, "Toko XXXX"
          Print #1, "Jl. Pramuka "
          Print #1, "(0XX) XXXXXX"
          Print #1, "================================"
          Print #1, "No. Nota : ";
          Print #1, tbs("notajual")
          Print #1, "Tanggal  : ";
          Print #1, tbs("tgljual")
          Print #1, "Jam      : " + Str(Time())
          Print #1, "--------------------------------"
       End If
       Printer.CurrentX = (1 * 567)
       Printer.CurrentY = (4 * 567) + (deret * 300)
       Print #1, tbs("namabrg")
       Print #1, tbs("jmljual");
       Print #1, "X ";
       Print #1, Format(tbs("hargajual"), "###,##0");
       Print #1, Tab(20);
       Print #1, Format(tbs("jmljual") * tbs("hargajual"), "###,##0")
       deret = deret + 1
       vsubtotal = vsubtotal + (tbs("hargajual") * tbs("jmljual"))
       tbs.MoveNext
    Loop
    Printer.CurrentX = (1 * 567)
    Printer.CurrentY = (5.5 * 567) + (deret * 300)
    Print #1, "Total";
    Print #1, Tab(20);
    Print #1, Format(Text15.Text, "###,##0")
    Printer.CurrentX = (1 * 567)
    Printer.CurrentY = (6 * 567) + (deret * 300)
    Print #1, "Bayar";
    Print #1, Tab(20);
    Print #1, Format(Text12.Text, "###,##0")
    Printer.CurrentX = (1 * 567)
    Printer.CurrentY = (6.5 * 567) + (deret * 300)
    Print #1, "Kembali";
    Print #1, Tab(20);
    Print #1, Format(Text13.Text, "###,##0")
    Print #1, "================================"
    Printer.CurrentX = (1 * 567)
    Printer.CurrentY = (7.5 * 567) + (deret * 300)
    Print #1, "*** TERIMA KASIH ***"
    Printer.FontSize = 10
    Printer.CurrentX = (1 * 567)
    Printer.CurrentY = (8 * 567) + (deret * 300)
    Print #1, "Atas Kunjungan Anda"
    Print #1, "  "
    Print #1, "  "
    Print #1, "  "
    Print #1, "  "
    Print #1, "  "
    Print #1, "  "
    Close #1
Else
   p = MsgBox("Data belum ada...!", vbOKOnly + vbInformation, "Informasi")

End If

'peringatanprinter:
'p = MsgBox("Ada gangungan dengan saluran printer...!", vbOKOnly + vbInformation, "Informasi")
'Exit Sub
End Sub




Terima kasih sebelumnya............

Batari