You are on page 1of 1

Private Sub CMDTMBH_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("PARTSDATA") 'menemukan baris kosong pada database

iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'check untuk sebuah kode If Trim(Me.tkode.Value) = "" Then Me.tkode.SetFocus MsgBox "Masukan Kode Barang" Exit Sub End If 'copy data ke database ws.Cells(iRow, 1).Value ws.Cells(iRow, 2).Value ws.Cells(iRow, 3).Value ws.Cells(iRow, 4).Value 'clear data Me.tkode.Value = "" Me.tnama.Value = "" Me.tsatuan.Value = "" Me.tharga.Value = "" Me.tkode.SetFocus End Sub Private Sub CMDTTP_Click() Unload Me End Sub Private Sub UserForm_QueryClose(Cancel As Integer, _ CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True MsgBox "MAKE TOMBOL ATUH KANG!" End If End Sub = = = = Me.tkode.Value Me.tnama.Value Me.tsatuan.Value Me.tharga.Value

You might also like