Form Pelanggan - Sistem Informasi Penjualan (VB6)

Designlah form pelanggan sistem informasi penjualan (VB6) seperti tampilan diatas.

Semua Command Button diberi namanya cmdNav

Berikut merupakan listing program form pelanggan sistem informasi penjualan (VB6)

Private Sub CmdNav_Click(Index As Integer)
Select Case Index
    Case 0
        RUBAH False, True, False, False, True, True
        Call Hapus
        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 Data1.Recordset
            If .RecordCount = 0 Then Exit Sub
            .Delete
            .MoveFirst
        End With
        Call Hapus
    Case 4
        RUBAH True, False, False, False, False, True
        Call Hapus
    Case 5
        Unload Me
End Select
End Sub

Private Sub Form_Activate()
    RUBAH True, False, False, False, False, True
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 .NoMatch Then
                    RUBAH False, True, False, False, True, True
                Else
                    RUBAH False, False, True, True, True, True
                    Call Tampil
                End If
                txtNama.SetFocus
            End With
        End If
    End If
End Sub

Sub SimpanData(Log As Boolean)
    With Data1.Recordset
        If Log Then .AddNew Else .edit
        !KdPelanggan = txtKD.Text
        !Nama = txtNama.Text
        !Alamat = txtAlamat.Text
        !telp = txtTelp.Text
        If Log Then
            !TAGIHAN = 0
        End If
        .Update
    End With
    Data1.Refresh
    Call Hapus
End Sub

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

Sub Hapus()
    txtKD.Text = ""
    txtNama.Text = ""
    txtAlamat.Text = ""
    txtTelp.Text = ""
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

Demikianlah program form pelanggan sistem informasi penjualan (VB6), selamat mencoba.

Belum ada komentar untuk "Form Pelanggan - Sistem Informasi Penjualan (VB6)"

Post a Comment

Terima kasih sudah memberikan komentar anda dengan baik.Konversi KodeEmoticonFolllow

Back to Top