Sie sind auf Seite 1von 7

PEMBAYARAN

Private Sub CboCustomer_Change()

Range("SheetPembayaran!N1").Value = CboCustomer.Value

TxtIDBayar.Value = Range("SheetPembayaran!L2").Value

TxtAlamatBayar.Value = Range("SheetPembayaran!L3").Value

TxtJmlBayar.Value = Format(Range("SheetPembayaran!L4").Value, "Rp" & "#,##0")

End Sub

Private Sub CmdBack_Click()

With MultiPage1

.Pages(1).Enabled = True

.Value = MultiPage1.Value - 1

.Pages(2).Enabled = False

End With

End Sub

Private Sub CmdDataNext_Click()

With MultiPage1

.Value = MultiPage1.Value + 1

.Pages(2).Enabled = True

.Pages(1).Enabled = False

End With

End Sub

Private Sub CmdFinish_Click()

Dim Tgl As Date

Dim Row As Long

Tgl = DateSerial(Year(Date), Month(Date), Day(Date))

TxtTgl.Value = Format(TxtTgl.Value, "dd/mm/yyyy")

Tgl = TxtTgl.Value

Sheets("SheetPenjualan").Activate

Row = WorksheetFunction.CountA(Range("B:B")) + 4
Cells(Row, 2).Value = TxtID.Value

Cells(Row, 3).Value = TxtNama.Value

Cells(Row, 4).Value = TxtAlamat.Value

Cells(Row, 5).Value = Tgl

Cells(Row, 6).Value = TxtFaktur.Value

Cells(Row, 7).Value = TxtProduk.Value

Cells(Row, 8).Value = TxtHarga.Value

Cells(Row, 9).Value = TxtQty.Value

Cells(Row, 11).Value = TxtDP.Value

Cells(Row, 13).Value = TxtPeriode.Value

TxtID.Value = ""

TxtNama.Value = ""

TxtAlamat.Value = ""

TxtTgl.Value = ""

TxtFaktur.Value = ""

TxtProduk.Value = ""

TxtHarga.Value = ""

TxtQty.Value = ""

TxtDP.Value = ""

TxtPeriode.Value = ""

ThisWorkbook.Save

With MultiPage1

.Pages(1).Enabled = True

.Value = MultiPage1.Value

.Pages(2).Enabled = False

End With

End Sub

Private Sub CmdKembali_Click()

With MultiPage1

.Pages(0).Enabled = True

.Value = MultiPage1.Value
.Pages(1).Enabled = False

End With

End Sub

Private Sub CmdLhtLap_Click()

FormLaporan.Show

End Sub

Private Sub CmdSimpanBayar_Click()

Dim Tanggal As Date

Dim Row1 As Long

Tanggal = DateSerial(Year(Date), Month(Date), Day(Date))

TxtTglBayar.Value = Format(TxtTglBayar.Value, "dd/mm/yyyy")

Tanggal = TxtTglBayar.Value

Sheets("SheetPembayaran").Activate

Row1 = WorksheetFunction.CountA(Range("B:B")) + 4

Cells(Row1, 2).Value = Tanggal

Cells(Row1, 3).Value = TxtNotaBayar.Value

Cells(Row1, 4).Value = TxtIDBayar.Value

Cells(Row1, 5).Value = CboCustomer.Value

Cells(Row1, 6).Value = TxtAlamatBayar

Cells(Row1, 7).Value = TxtJmlBayar.Value

TxtTglBayar.Value = ""

TxtNotaBayar.Value = ""

TxtIDBayar.Value = ""

CboCustomer.Value = ""

TxtAlamatBayar.Value = ""

TxtJmlBayar.Value = ""

ThisWorkbook.Save

End Sub
Private Sub CmdTransaksiBaru_Click()

Select Case MultiPage1.Value

Case 0

With MultiPage1

.Value = MultiPage1.Value + 1

.Pages(1).Enabled = True

.Pages(0).Enabled = False

End With

End Select

End Sub

Private Sub CmdTutup_Click()

ThisWorkbook.Save

Me.Hide

Application.Quit

End Sub

Private Sub TxtDP_Change()

TxtDP.Value = Format(TxtDP.Value, "Rp" & "#,##0")

End Sub

Private Sub TxtHarga_Change()

TxtHarga.Value = Format(TxtHarga.Value, "Rp" & "#,##0")

End Sub

Private Sub UserForm_Initialize()

With MultiPage1

.Pages(1).Enabled = False

.Pages(2).Enabled = False

.Value = 0

End With

CmdKembali.Caption = "<<Back"

CmdDataNext.Caption = "Next>>"
CmdBack.Caption = "<<Back"

CmdFinish.Caption = "Finish"

End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

If CloseMode = vbFormControlMenu Then

MsgBox "Gunakan tombol Tutup Aplikasi"

Cancel = True

End If

End Sub

FORMLAPORAN

Private Sub CboCustomerLap_Change()

Dim HeadArray(), Tbl, r As Long, n As Long, c As Integer

Range("SheetPembayaran!N1").Value = CboCustomerLap

Tbl = Range("Pembayaran")

ReDim HeadArray(0 To 5)

With ListLap

.ColumnCount = 6

.ColumnWidths = "60;40;60;70;70;45"

.Clear

For c = 0 To 5

HeadArray(c) = Tbl(1, c + 1)

Next c

.AddItem: .Column() = HeadArray

n = 0: r = 0: c = 0

For r = 2 To Range("SheetPembayaran!A1").Value

If Tbl(r, 3) = Range("SheetPembayaran!L2").Value Then

n=n+1

For c = 1 To 6

.AddItem: .List(n, c - 1) = Tbl(r, c)

Next c

End If
Next r

End With

TxtFrekuensi.Value = Range("SheetPembayaran!N2").Value

TxtSisaPeriode.Value = Range("SheetPembayaran!N3").Value

TxtSisaKredit.Value = Format(Range("SheetPembayaran!N4").Value, "Rp" & "#,##0")

End Sub

Private Sub CmdTutup_Click()

Unload Me

End Sub

Private Sub TxtSisaKredit_Change()

TxtSisaKredit.Value = Format(TxtSisaKredit.Value, "Rp" & "#,##0")

End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

If CloseMode = vbFormControlMenu Then

MsgBox "Gunakan tombol Tutup Laporan"

Cancel = True

End If

End Sub

MODUL

Sub TampilFormAplikasi()

FormAplikasi.Show

End Sub

Sub TampilFormLaporan()

FormLaporan.Show

End Sub
THISWORKBOOK

Private Sub Workbook_BeforeClose(Cancel As Boolean)

ThisWorkbook.Save

End Sub

Private Sub Workbook_Open()

Application.Visible = False

FormAplikasi.Show

Application.Visible = True

End Sub

Das könnte Ihnen auch gefallen