Form Pembayaran - Sistem Informasi Penjualan (VB6)

Berikut merupakan form pembayaran dari sistem informasi penjualan (VB6), designlah seperti form tersebut di bawah ini :
Form Pembayaran - Sistem Informasi Penjualan (VB6)
Form Pembayaran - Sistem Informasi Penjualan (VB6)














Ini merupakan listing program dari form pembayaran sistem informasi penjualan (VB6)

Private Sub Bayar_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Sisa.Text = Val(Total.Text) - Val(Bayar.Text)
    End If
End Sub

Private Sub CmdNav_Click(Index As Integer)
Select Case Index
    Case 0
        RUBAH False, True, False, False, True, True
        Call HapusTrans
        txtKD.SetFocus
    Case 1
        RUBAH True, False, False, False, False, True
        SimpanData True
    Case 2
        RUBAH True, False, False, False, False, True
        SimpanData False
    Case 3
        With Data2.Recordset
            If .RecordCount = 0 Then Exit Sub
            .Delete
            .MoveFirst
        End With
        Call HapusTrans
    Case 4
        RUBAH True, False, False, False, False, True
        Call HapusTrans
    Case 5
        Unload Me
End Select
End Sub

Private Sub Form_Activate()
    RUBAH True, False, False, False, False, True
    HapusTrans
End Sub

Private Sub txtKd_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
    If KeyAscii = 13 Then
        If txtKD.Text = "" Then
            txtKD.SetFocus
        Else
            With Data1.Recordset
                .Index = "KdPelanggan"
                .Seek "=", txtKD.Text
                If Not .NoMatch Then
                    Call Tampil
                    Bayar.SetFocus
                Else
                    MsgBox "Maaf ! Data Pelanggan Tidak Ada...", vbOKOnly, "Data Pelanggan"
                    Hapus
                    txtKD.SetFocus
                End If
            End With
        End If
    End If
End Sub

Sub SimpanData(Log As Boolean)
    With Data2.Recordset
        If Log Then .AddNew Else .edit
        !Nobukti = txtNO.Text
        !KdPelanggan = txtKD.Text
        !Tanggal = txtTanggal.Value
        !Total = Total.Text
        !Jumlah = Bayar.Text
        !Sisa = Sisa.Text
        .Update
    End With
   
    With Data1.Recordset
        .edit
        !Tagihan = Sisa.Text
        .Update
    End With
    Data1.Refresh
    Data2.Refresh
    Call HapusTrans
End Sub

Sub Tampil()
    'On Error Resume Next
    With Data1.Recordset
        txtNama.Text = !Nama
        txtTelp.Text = !telp
        Total.Text = !Tagihan
    End With
End Sub

Sub TampilTrans()
    'On Error Resume Next
    With Data2.Recordset
        txtNO.Text = !Nobukti
        Total.Text = !Total
        Sisa.Text = !Sisa
        Bayar.Text = !Jumlah
        txtKD.Text = !KdPelanggan
        txtTanggal.Value = !Tanggal
        txtKd_KeyPress 13
    End With
End Sub

Sub Hapus()
    txtKD.Text = ""
    txtNama.Text = ""
    txtTelp.Text = ""
End Sub

Sub HapusTrans()
    txtNO.Text = ""
    Bayar.Text = ""
    Sisa.Text = ""
    Total.Text = ""
    txtTanggal.Value = Now
    Hapus
End Sub

Sub RUBAH(L0 As Boolean, L1 As Boolean, L2 As Boolean, L3 As Boolean, L4 As Boolean, L5 As Boolean)
    CmdNav(0).Enabled = L0
    CmdNav(1).Enabled = L1
    CmdNav(2).Enabled = L2
    CmdNav(3).Enabled = L3
    CmdNav(4).Enabled = L4
    CmdNav(5).Enabled = L5
End Sub

Private Sub txtNO_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
    If KeyAscii = 13 Then
        If txtNO.Text = "" Then
            txtNO.SetFocus
        Else
            With Data2.Recordset
                .Index = "NoBukti"
                .Seek "=", txtNO.Text
                If .NoMatch Then
                    RUBAH False, True, False, False, True, True
                Else
                    RUBAH False, False, True, True, True, True
                    Call TampilTrans
                End If
                txtKD.SetFocus
            End With
        End If
    End If
End Sub

1 Komentar untuk "Form Pembayaran - Sistem Informasi Penjualan (VB6)"

  1. izin jadikan referensi gan, ditunggu kunjungan baliknya
    https://carakuvb6.blogspot.com/

    ReplyDelete

Terima kasih sudah memberikan komentar anda dengan baik.Konversi KodeEmoticonFolllow

Back to Top