• Tidak ada hasil yang ditemukan

Lampiran A-1 Keluaran Sistem Berjalan Laporan Pembelian Barang

N/A
N/A
Protected

Academic year: 2022

Membagikan "Lampiran A-1 Keluaran Sistem Berjalan Laporan Pembelian Barang"

Copied!
56
0
0

Teks penuh

(1)

LAMPIRAN- A

KELUARAN SISTEM BERJALAN

Lampiran A-1

Keluaran Sistem Berjalan Laporan Pembelian Barang

(2)

LAMPIRAN - B

MASUKAN SISTEM BERJALAN

Lampiran B-1

Nota

(3)

LAMPIRAN - C

RANCANGAN KELUARAN SISTEM BERJALAN

Lampiran C- 1

Rancangan Keluaran Sistem Berjalan Surat pesanan

(4)

Lampiran C- 2

Rancangan Keluaran Cetak Laporan pembelian

(5)

LAMPIRAN - D

RANCANGAN MASUKAN SISTEM BERJALAN

Lampiaran D-1

Rancangan Masukan Data Supplier

(6)

LampiranD- 2

Rancangan Masukan Data Barang

(7)

Lampiran D-3

Rancangan Masukan Data Pesanan

(8)

LampiranD-4

Rancangan Masukan Data Nota

Lampiran E

(9)

Surat Keterangan Riset

TOKO IMRAN

Jl Usman Ambon no 97 Pangkalpinang Provinsi Kepulauan Bangka Belitung

Surat Keterangan

Yang Bertanda Tangan dibawah ini : Nama : Imran

Jabatan : Pemilik Toko

Menerangkan bahwa : Nama : Inawa Septian Putra

Nim : 0722300022

Telah melaksanakan riset pada TOKO IMRAN sejak tanggal 20 Mei s/d 15 Juli 2010 dengan baik.

Demikianlah surat keterangan ini dibuat untuk dipergunakan semestinya.

Dibuat : Pangkalpinang Tanggal : 15 Juli 2010

Pemilik Toko

Imran LampiranE-1 Surat Keterangan Riset

(10)

Listing Program

Listing Menu Utama Dim text As String

Private Sub Ctaklapbeli_Click() laporan.Show

End Sub

Private Sub MDIForm_Load()

text = " Sistem Informasi Pembelian Tunai Toko Imran "

CheckSoftware Menu_Utama End Sub

Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)

If UnloadMode <> vbFormCode Then Cancel = True

End If End Sub

Private Sub Mnbarang_Click() Barang.Show

End Sub

Private Sub Mnclaporan_Click() Ctak_pesanan.Show

End Sub

(11)

Private Sub Mnkeluar_Click() End

End Sub

Private Sub Mnnota_Click() Nota.Show

End Sub

Private Sub Mnpesanan_Click() Pesanan.Show

End Sub

Private Sub Mnsupplier_Click() Supplier.Show

End Sub

Private Sub Timer1_Timer() a = Left(text, 1)

b = Len(text)

c = Right(text, b - 1) text = c + a

StatusBar1.Panels(1).text = text End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Index

Case 1 Barang.Show Case 2

(12)

Supplier.Show End Select End Sub

Listing Master Entry Data Barang Sub Simpan()

On Error GoTo salah Me.MousePointer = 11 hackingdatabase.BeginTrans

hackingdatabase.Execute "Insert Into barang values ('" & txtkode.text & "',"

& _

"'" & txtnama.text & "','" & txtsatuan.text & "','" & txtharga.text & "','" &

txtjumlah.text & "')"

hackingdatabase.CommitTrans Me.MousePointer = 1

MsgBox "Data barang sudah disimpan..", vbInformation, "Sukses"

Exit Sub salah:

MsgBox "Data barang gagal di simpan...", vbInformation, "Periksa"

End Sub Sub Edit()

On Error GoTo salah Me.MousePointer = 11 hackingdatabase.BeginTrans

hackingdatabase.Execute "Update barang set [Nm_brg]='" & txtnama.text

& "',[satuan]='" & _

txtsatuan.text & "',[hrg_brg]='" & txtharga.text & "', [jumlah]='" &

txtjumlah.text & "'where [Kd_brg]='" & txtkode.text & "'"

(13)

hackingdatabase.CommitTrans Me.MousePointer = 1

MsgBox "Data barang sudah di edit..", vbInformation, "Sukses Edit"

Exit Sub salah:

MsgBox "Data barang tidak bisa di edit..", , "Periksa"

End Sub Sub Semula() Bersih

vEdit = False vTrans = False

'Cmdsimpan.Enabled = False 'cmdHapus.Enabled = False 'cmdEdit.Enabled = False 'cmdBaru.Caption = "&Baru"

NotAktif DaftarBarang

'cmdCari.Enabled = True 'cmdBaru.SetFocus

End Sub Sub Bersih() Dim Control

For Each Control In Me.Controls If TypeOf Control Is TextBox Then Control.text = ""

End If

'If TypeOf Control Is ComboBox Then 'Control.Text = ""

(14)

'End If Next Control End Sub Sub NotAktif() Dim Control

For Each Control In Me.Controls If TypeOf Control Is TextBox Then Control.Enabled = True

End If

'If TypeOf Control Is ComboBox Then 'Control.Enabled = False

'End If Next Control End Sub

Sub DaftarCari() With TCari

txtkode = ![Kd_brg]

txtnama = ![Nm_brg]

txtsatuan = ![satuan]

txtharga = ![hrg_brg]

txtjumlah = ![jumlah]

End With End Sub

Private Sub Form_Load() Ketengah Me

DaftarBarang

If Tab1.Tab = 1 Then Tab1.Tab = 0 Exit Sub

(15)

End If End Sub

Sub DaftarBarang() On Error GoTo salah Me.MousePointer = 11

Kata = "Select * From [barang] Order By [kd_brg]"

Set Tbarang = New ADODB.Recordset

Tbarang.Open Kata, hackingdatabase, adOpenStatic, adLockReadOnly LV1.ListItems.Clear

If Not Tbarang.EOF Then Tbarang.MoveFirst i = 1

While Not Tbarang.EOF

Set Vbutir = LV1.ListItems.Add(, , i & ".") Vbutir.SubItems(1) = Tbarang![Kd_brg]

Vbutir.SubItems(2) = Tbarang![Nm_brg]

Vbutir.SubItems(3) = Tbarang![satuan]

Vbutir.SubItems(4) = Tbarang![hrg_brg]

Vbutir.SubItems(5) = Tbarang![jumlah]

Tbarang.MoveNext i = i + 1

Wend End If

Tbarang.Close

Set Tbarang = Nothing Me.MousePointer = 1 Exit Sub

salah:

(16)

MsgBox Err.Description End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) On Error Resume Next

Do Until Me.Top <= -5000 DoEvents

Me.Move Me.Left, Me.Top - 15 DoEvents

Loop Unload Me End Sub

Private Sub Form_Unload(Cancel As Integer) If Not vTrans Then

Unload Me

Set Tbarang = Nothing Set Barang = Nothing Else

Kata = MsgBox("Data barang belum di simpan...." & vbCrLf & _

"Data barang mau di simpan...", vbInformation + vbYesNo, "barang Belum di Simpan")

If Kata = vbYes Then

'Cmdsimpan.Enabled = True 'cmdSimpan_Click

Set Tbarang = Nothing Set Barang = Nothing Unload Me

Exit Sub End If

Set Tbarang = Nothing

(17)

Set Barang = Nothing Unload Me

End If End Sub

Private Sub Lv1_DblClick() With Barang

.txtkode = LV1.SelectedItem.SubItems(1) .txtnama = LV1.SelectedItem.SubItems(2) .txtsatuan = LV1.SelectedItem.SubItems(3) .txtharga = LV1.SelectedItem.SubItems(4) .txtjumlah = LV1.SelectedItem.SubItems(5)

'.cmdHapus.Enabled = True '.cmdEdit.Enabled = True '.cmdBaru.Caption = "&Batal"

.Tab1.Tab = 0 End With

End Sub

Private Sub Tab1_Click(PreviousTab As Integer) If Tab1.Tab = 1 Then

If LV1.ListItems.Count = 0 Then

MsgBox "Daftar barang masih kosong.." & vbCrLf & _ "Entry Data barang...."

Tab1.Tab = 0 End If

Else

DaftarBarang End If

(18)

End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Index

Case 1

Me.MousePointer = 11 If Not vEdit Then Simpan

txtkode.SetFocus Else

Edit End If Semula

Case 2

Me.MousePointer = 11 vEdit = True

vTrans = True txtnama.SetFocus txtkode.Enabled = False 'cmdHapus.Enabled = False 'Cmdsimpan.Enabled = True 'cmdBaru.Caption = "&Batal"

'cmdCari.Enabled = False Me.MousePointer = 1

Case 3 Dim cari ulang:

(19)

cari = InputBox("Masukkan Kode barang yang akan di cari...", "Cari Kode barang")

If cari = "" Then Exit Sub

Me.MousePointer = 11

Set TCari = New ADODB.Recordset

Kata = "Select * from barang where [Kd_brg]='" & cari & "'"

TCari.Open Kata, hackingdatabase, adOpenDynamic, adLockPessimistic

If TCari.EOF Then TCari.Close

Set TCari = Nothing Me.MousePointer = 1

If MsgBox("Kode barang = " & cari & " tidak ditemukan.." & vbCrLf & _ "Apakah masih ada kode barang yang akan dicari...", vbInformation + vbYesNo) = vbYes Then

GoTo ulang Else

' TCari.Close

Set TCari = Nothing Me.MousePointer = 1 End If

Else

DaftarCari

Set TCari = Nothing 'Cmdedit.Enabled = True 'cmdHapus.Enabled = True Me.MousePointer = 1 End If

(20)

Case 4 Bersih

Case 5

On Error GoTo salah

If MsgBox("Data barang " & LV1.SelectedItem.SubItems(2) & " Akan di hapus..", vbCritical + vbYesNo, "Informasi System") = vbYes Then

Me.MousePointer = 11 hackingdatabase.BeginTrans

Kata = "Delete From [barang] Where [Kd_brg]='" & txtkode.text & "'"

hackingdatabase.Execute Kata hackingdatabase.CommitTrans Me.MousePointer = 1

Semula Exit Sub End If

Me.MousePointer = 1 Exit Sub

salah:

MsgBox "Data tidak dapat di hapus..., coba periksa kembali..", vbInformation

Me.MousePointer = 1

Case 6

Unload Me

End Select

(21)

End Sub

Listing Program Master Supplier Private Sub Form_Load()

Ketengah Me daftarsupplier

If Tab1.Tab = 1 Then Tab1.Tab = 0 Exit Sub End If End Sub

Sub daftarsupplier() On Error GoTo salah Me.MousePointer = 11

Kata = "select * from[supplier] order By [kd_supplier]"

Set Tsupplier = New ADODB.Recordset

Tsupplier.Open Kata, hackingdatabase, adOpenStatic, adLockReadOnly LV1.ListItems.Clear

If Not Tsupplier.EOF Then Tsupplier.MoveFirst i = 1

While Not Tsupplier.EOF

Set Vbutir = LV1.ListItems.Add(, , i & ".") Vbutir.SubItems(1) = Tsupplier![Kd_supplier]

Vbutir.SubItems(2) = Tsupplier![nm_supplier]

Vbutir.SubItems(3) = Tsupplier![alamat]

Vbutir.SubItems(4) = Tsupplier![telephone]

Tsupplier.MoveNext i = i + 1

(22)

Wend End If

Tsupplier.Close

Set Tsupplier = Nothing Me.MousePointer = 1 Exit Sub

salah:

MsgBox Err.Description End Sub

Private Sub Lv1_DblClick() With Supplier

.txtkode = LV1.SelectedItem.SubItems(1) .txtnama = LV1.SelectedItem.SubItems(2) .txtalamat = LV1.SelectedItem.SubItems(3) .txtcall = LV1.SelectedItem.SubItems(4)

.Tab1.Tab = 0 End With End Sub

Private Sub Tab1_Click(PreviousTab As Integer) If Tab1.Tab = 1 Then

If LV1.ListItems.Count = 0 Then

MsgBox "Daftar supplier masih kosong.." & vbCrLf & _ "Entry Data supplier...."

Tab1.Tab = 0 End If

Else

daftarsupplier End If

(23)

End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Index

Case 1

Me.MousePointer = 11 If Not vEdit Then Simpan

txtkode.SetFocus Else

Edit End If Semula

Case 2

Me.MousePointer = 11 vEdit = True

vTrans = True txtnama.SetFocus Me.MousePointer = 1

Case 3 Dim cari ulang:

cari = InputBox("Masukkan Kode Supplier yang akan di cari...", "Cari Kode supplier")

If cari = "" Then Exit Sub

(24)

Me.MousePointer = 11

Set TCari = New ADODB.Recordset

Kata = "Select * from supplier where [Kd_supplier]='" & cari & "'"

TCari.Open Kata, hackingdatabase, adOpenDynamic, adLockPessimistic

If TCari.EOF Then TCari.Close

Set TCari = Nothing Me.MousePointer = 1

If MsgBox("Kode Supplier = " & cari & " tidak ditemukan.." & vbCrLf &

_

"Apakah masih ada kode Supplier yang akan dicari...", vbInformation + vbYesNo) = vbYes Then

GoTo ulang Else

' TCari.Close

Set TCari = Nothing Me.MousePointer = 1 End If

Else

DaftarCari

Set TCari = Nothing 'Cmdedit.Enabled = True 'cmdHapus.Enabled = True Me.MousePointer = 1 End If

Case 4 Bersih

(25)

Case 5

On Error GoTo salah

If MsgBox("Data Supplier " & LV1.SelectedItem.SubItems(2) & " Akan di hapus..", vbCritical + vbYesNo, "Informasi System") = vbYes Then

Me.MousePointer = 11 hackingdatabase.BeginTrans

Kata = "Delete From [Supplier] Where [Kd_supplier]='" & txtkode.text &

"'"

hackingdatabase.Execute Kata hackingdatabase.CommitTrans Me.MousePointer = 1

Semula Exit Sub End If

Me.MousePointer = 1 Exit Sub

salah:

MsgBox "Data tidak dapat di hapus..., coba periksa kembali..", vbInformation

Me.MousePointer = 1

Case 6 Unload Me

End Select End Sub

Sub DaftarCari() With TCari

(26)

txtkode = ![Kd_supplier]

txtnama = ![nm_supplier]

txtalamat = ![alamat]

txtcall = ![telephone]

End With End Sub Sub Simpan()

On Error GoTo salah Me.MousePointer = 11 hackingdatabase.BeginTrans

hackingdatabase.Execute "Insert Into Supplier values ('" & txtkode.text &

"'," & _

"'" & txtnama.text & "','" & txtalamat.text & "','" & txtcall.text & "')"

hackingdatabase.CommitTrans Me.MousePointer = 1

MsgBox "Data supplier sudah disimpan..", vbInformation, "Sukses"

Exit Sub salah:

MsgBox "Data supplier gagal di simpan...", vbInformation, "Periksa"

End Sub Sub Edit()

On Error GoTo salah Me.MousePointer = 11 hackingdatabase.BeginTrans

hackingdatabase.Execute "Update supplier set [Nm_supplier]='" &

txtnama.text & "',[alamat]='" & _

txtalamat.text & "',[telephone]='" & txtcall.text & "'where [Kd_supplier]='" &

txtkode.text & "'"

(27)

hackingdatabase.CommitTrans Me.MousePointer = 1

MsgBox "Data supplier sudah di edit..", vbInformation, "Sukses Edit"

Exit Sub salah:

MsgBox "Data supplier tidak bisa di edit..", , "Periksa"

End Sub Sub Semula() Bersih

vEdit = False vTrans = False

NotAktif daftarsupplier

End Sub Sub Bersih() Dim Control

For Each Control In Me.Controls If TypeOf Control Is TextBox Then Control.text = ""

End If

'If TypeOf Control Is ComboBox Then 'Control.Text = ""

'End If Next Control End Sub Sub NotAktif()

(28)

Dim Control

For Each Control In Me.Controls If TypeOf Control Is TextBox Then Control.Enabled = True

End If

'If TypeOf Control Is ComboBox Then 'Control.Enabled = False

'End If Next Control End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) On Error Resume Next

Do Until Me.Top <= -5000 DoEvents

Me.Move Me.Left, Me.Top - 10 DoEvents

Loop Unload Me End Sub

Private Sub Form_Unload(Cancel As Integer) If Not vTrans Then

Unload Me

Set Tsupplier = Nothing Set Supplier = Nothing Else

Kata = MsgBox("Data supplier belum di simpan...." & vbCrLf & _ "Data supplier mau di simpan...", vbInformation + vbYesNo,

"supplier Belum di Simpan")

(29)

If Kata = vbYes Then

'Cmdsimpan.Enabled = True 'cmdSimpan_Click

Set Tsupplier = Nothing Set Supplier = Nothing Unload Me

Exit Sub End If

Set Tsupplier = Nothing Set Supplier = Nothing Unload Me

End If End Sub

Entry Nota

Private Sub Auto() Dim Hitung As Byte

Dim tanggal, Tahun As Date tanggal = Format(Now, "mmyy")

Set Tnota = New ADODB.Recordset

Tnota.Open "Select * From nota ", hackingdatabase, adOpenStatic, adLockReadOnly

With Tnota

If .RecordCount = 0 Then Urutan = "000" & "001"

Else

.MoveLast

(30)

If Val(Left(.Fields("No_nota"), 5)) <> "000" Then Urutan = "00" & "001"

Else

Hitung = Val(Right(.Fields("No_nota"), 6)) + 1 Urutan = "00" & Right("000" & Hitung, 6) End If

End If

txtno.text = Urutan End With

End Sub

Private Sub cmdenter_Click() If Combo1 <> "" Then

If vEdit = False Then Me.MousePointer = 11

Set Vbutir = LV1.ListItems.Add(, , LV1.ListItems.Count + 1 & ".") Vbutir.SubItems(1) = txtno.text

Vbutir.SubItems(2) = Combo1.text Vbutir.SubItems(3) = txttanggal.text Vbutir.SubItems(4) = txttglpsn.text Vbutir.SubItems(5) = txtnmsup.text Vbutir.SubItems(6) = txtalamat.text

vTrans = True

Me.MousePointer = 1

Pesan = MsgBox("Apakah Ada Kesalahan Dalam Menginput data...", vbQuestion + vbYesNo, "Informasi..")

If Pesan = vbYes Then

(31)

txttglpsn = ""

txtnmsup = ""

txtalamat = ""

Exit Sub End If

Me.MousePointer = 1

Else

vTrans = True

If LV1.ListItems.Count > 0 Then

LV1.ListItems.Remove LV1.SelectedItem.Index For i = 1 To LV1.ListItems.Count

LV1.ListItems(i).text = i & "."

Next i End If

'txtsub.text = Val(Int(txthrg)) * Val(Int(txtjml))

Set Vbutir = LV1.ListItems.Add(, , LV1.ListItems.Count + 1 & ".") Vbutir.SubItems(1) = txtno.text

Vbutir.SubItems(2) = Combo1.text Vbutir.SubItems(3) = txttanggal.text Vbutir.SubItems(4) = txttglpsn.text Vbutir.SubItems(5) = txtnmsup.text Vbutir.SubItems(6) = txtalamat.text End If

End If

(32)

End Sub

Private Sub Combo1_Click() If Combo1.text <> "" Then Me.MousePointer = 11

Kata = "Select * from Qdatanota where [no_pesanan]='" & Combo1.text & "'"

Set TQnota = New ADODB.Recordset

TQnota.Open Kata, hackingdatabase, adOpenDynamic, adLockPessimistic

If TQnota.EOF Then TQnota.Close

Set TQnota = Nothing Me.MousePointer = 1

MsgBox "No Pesanan = & " & Combo1.text & " tidak terdaftar...", vbInformation

Combo1.SetFocus Exit Sub

End If

With TQnota

txttglpsn = ![tgl_pesanan]

txtnmsup = ![nm_supplier]

txtalamat = ![alamat]

End With TQnota.Close

Set TQnota = Nothing Me.MousePointer = 1

(33)

cmdenter.SetFocus

End If End Sub

Sub daftardatanota() Me.MousePointer = 11

Kata = "Select * from Qdatanota Order By [no_pesanan]"

Set TQnota = New ADODB.Recordset

TQnota.Open Kata, hackingdatabase, adOpenDynamic Combo1.Clear

If Not TQnota.EOF Then TQnota.MoveFirst While Not TQnota.EOF

Combo1.AddItem TQnota![No_pesanan]

TQnota.MoveNext Wend

End If

TQnota.Close

Set TQnota = Nothing Me.MousePointer = 1 End Sub

Private Sub Form_Load() Ketengah Me

End Sub Sub baru()

On Error Resume Next Me.MousePointer = 11

(34)

If cmdBaru.Caption = "&Baru" Then cmdBaru.Caption = "&Batal"

Auto

txttanggal.Enabled = True txttanggal.SetFocus vEdit = False

Else Semula End If

Me.MousePointer = 1 End Sub

Sub Semula() Bersih

vEdit = False vTrans = False NotAktif

LV1.ListItems.Clear End Sub

Sub Bersih() Dim Control

For Each Control In Me.Controls If TypeOf Control Is TextBox Then Control.text = ""

End If

If TypeOf Control Is ComboBox Then Control.text = ""

End If Next Control End Sub

(35)

Sub NotAktif() Dim Control

For Each Control In Me.Controls If TypeOf Control Is TextBox Then Control.Enabled = False

End If

If TypeOf Control Is ComboBox Then Control.Enabled = False

End If Next Control End Sub

Private Sub txtTanggal_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then

daftardatanota

If Combo1.ListCount = 0 Then

MsgBox "Data Pesanan masih kosong..,," & vbCrLf & _ "Coba periksa kembali...", vbCritical

Unload Me Exit Sub End If

r = SendMessageLong(Combo1.hwnd, CB_SHOWDROPDOWN, True, 0)

Combo1.Enabled = True Frame1.Enabled = True End If

End Sub

Private Sub txtjml_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then

If Combo1 <> "" Then

(36)

If vEdit = False Then Me.MousePointer = 11

Set Vbutir = LV1.ListItems.Add(, , LV1.ListItems.Count + 1 & ".") Vbutir.SubItems(1) = Combo1.text

Vbutir.SubItems(2) = txttglpsn.text Vbutir.SubItems(3) = txtnmsup.text Vbutir.SubItems(4) = txtalamat.text

vTrans = True

Me.MousePointer = 1 End If

End If End Sub Sub Simpan()

On Error GoTo salah Me.MousePointer = 11 hackingdatabase.BeginTrans

hackingdatabase.Execute "Insert Into nota values ('" & txtno.text & "'," & _ "'" & Combo1.text & "','" & txttanggal.text & "')"

hackingdatabase.CommitTrans Me.MousePointer = 1

MsgBox "Data Nota Sudah disimpan..", vbInformation, "Sukses"

Exit Sub salah:

MsgBox "Data Nota gagal di simpan...", vbInformation, "Periksa"

End Sub

Private Sub Lv1_Click()

If Not LV1.ListItems.Count = 0 Then

(37)

Exit Sub End If End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Index

Case 1 baru Case 2

Me.MousePointer = 11 If Not vEdit Then Simpan

Else 'Edit End If Semula

Case 3 Bersih 'Case 4

'Editnota.Show Case 4

Unload Me End Select End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) On Error Resume Next

Do Until Me.Top <= -5000 DoEvents

Me.Move Me.Left, Me.Top - 15

(38)

DoEvents Loop

Unload Me End Sub

Entry Pesanan Private Sub Auto() Dim Hitung As Byte

Dim tanggal, Tahun As Date tanggal = Format(Now, "mmyy")

Set Tpesanan = New ADODB.Recordset

Tpesanan.Open "Select * From pesanan ", hackingdatabase, adOpenStatic, adLockReadOnly

With Tpesanan

If .RecordCount = 0 Then Urutan = "000" & "001"

Else

.MoveLast

If Val(Left(.Fields("No_pesanan"), 5)) <> "000" Then Urutan = "00" & "001"

Else

Hitung = Val(Right(.Fields("No_pesanan"), 6)) + 1 Urutan = "00" & Right("000" & Hitung, 6)

End If End If

txtnopsn.text = Urutan End With

(39)

End Sub

Private Sub Combo1_Click() If Combo1.text <> "" Then Me.MousePointer = 11

Kata = "Select * from supplier where [kd_supplier]='" & Combo1.text & "'"

Set Tsupplier = New ADODB.Recordset

Tsupplier.Open Kata, hackingdatabase, adOpenDynamic, adLockPessimistic

If Tsupplier.EOF Then Tsupplier.Close

Set Tsupplier = Nothing Me.MousePointer = 1

MsgBox "Kode supplier = & " & Combo1.text & " tidak terdaftar...", vbInformation

Combo1.SetFocus Exit Sub

End If

With Tsupplier

txtnmsup = ![nm_supplier]

txtalamat = ![alamat]

End With

Tsupplier.Close

Set Tsupplier = Nothing Me.MousePointer = 1

End If End Sub

Private Sub combo1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then

(40)

If Combo1.text <> "" Then Me.MousePointer = 11

Kata = "Select * from supplier where [Kd_supplier]='" & Combo1.text & "'"

Set Tsupplier = New ADODB.Recordset

Tsupplier.Open Kata, hackingdatabase, adOpenDynamic, adLockPessimistic

If Tsupplier.EOF Then Tsupplier.Close

Set Tsupplier = Nothing Me.MousePointer = 1

MsgBox "Kode supplier = & " & Combo1.text & " tidak terdaftar...", vbInformation

Combo1.SetFocus Exit Sub

End If

With Tsupplier

txtnmsup = ![nm_supplier]

txtalamat = ![alamat]

End With

Tsupplier.Close

Set Tsupplier = Nothing Me.MousePointer = 1 DaftarBarang

If Combo2.ListCount = 0 Then

MsgBox "Data barang masih kosong..,," & vbCrLf & _ "Coba periksa kembali...", vbCritical

Unload Me Exit Sub End If

(41)

r = SendMessageLong(Combo2.hwnd, CB_SHOWDROPDOWN, True, 0) Combo2.Enabled = True

End If End If End Sub

Sub daftarsupplier() Me.MousePointer = 11

Kata = "Select * from supplier Order By [Kd_supplier]"

Set Tsupplier = New ADODB.Recordset

Tsupplier.Open Kata, hackingdatabase, adOpenDynamic Combo1.Clear

If Not Tsupplier.EOF Then Tsupplier.MoveFirst While Not Tsupplier.EOF

Combo1.AddItem Tsupplier![Kd_supplier]

Tsupplier.MoveNext Wend

End If

Tsupplier.Close

Set Tsupplier = Nothing Me.MousePointer = 1 End Sub

Private Sub Combo2_Click() If Combo2.text <> "" Then Me.MousePointer = 11

Kata = "Select * from barang where [Kd_brg]='" & Combo2.text & "'"

Set Tbarang = New ADODB.Recordset

Tbarang.Open Kata, hackingdatabase, adOpenDynamic, adLockPessimistic If Tbarang.EOF Then

(42)

Tbarang.Close

Set Tbarang = Nothing Me.MousePointer = 1

MsgBox "Kode barang = & " & Combo2.text & " tidak terdaftar...", vbInformation

Combo2.SetFocus Exit Sub

End If

With Tbarang

txtnmbrg = ![Nm_brg]

txtsatuan = ![satuan]

txthrg = ![hrg_brg]

End With Tbarang.Close

Set Tbarang = Nothing Me.MousePointer = 1

End If End Sub

Private Sub combo2_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then

If Combo2.text <> "" Then Me.MousePointer = 11

Kata = "Select * from barang where [Kd_brg]='" & Combo2.text & "'"

Set Tbarang = New ADODB.Recordset

Tbarang.Open Kata, hackingdatabase, adOpenDynamic, adLockPessimistic

If Tbarang.EOF Then Tbarang.Close

(43)

Set Tbarang = Nothing Me.MousePointer = 1

MsgBox "Kode barang = & " & Combo2.text & " tidak terdaftar...", vbInformation

Combo2.SetFocus Exit Sub

End If

With Tbarang

txtnmbrg = ![Nm_brg]

txtsatuan = ![satuan]

txthrg = ![hrg_brg]

End With Tbarang.Close

Set Tbarang = Nothing Me.MousePointer = 1 End If

End If

End Sub

Sub DaftarBarang() Me.MousePointer = 11

Kata = "Select * from Barang Order By [Kd_brg]"

Set Tbarang = New ADODB.Recordset

Tbarang.Open Kata, hackingdatabase, adOpenDynamic Combo2.Clear

If Not Tbarang.EOF Then Tbarang.MoveFirst While Not Tbarang.EOF

Combo2.AddItem Tbarang![Kd_brg]

(44)

Tbarang.MoveNext Wend

End If

Tbarang.Close

Set Tbarang = Nothing Me.MousePointer = 1 End Sub

Sub Databarang()

On Error GoTo Barangkosong

Set Tbarang = New ADODB.Recordset

Tbarang.Open "Select * from barang", hackingdatabase, adOpenDynamic, adLockPessimistic

If Tbarang.RecordCount = 0 Then Tbarang.Close

Set Tbarang = Nothing

MsgBox "data Obat masih kosong...", vbInformation Timer1.Enabled = False

Unload Me Exit Sub End If

Listbrg.Clear

Timer1.Enabled = False Do Until Tbarang.EOF

Listbrg.AddItem Tbarang![Kd_brg] & vbTab & Tbarang![Nm_brg]

Tbarang.MoveNext Loop

Tbarang.Close

Set Tbarang = Nothing Exit Sub

(45)

Barangkosong:

MsgBox Err.Description End Sub

Private Sub Form_Load() Ketengah Me

End Sub Sub baru()

On Error Resume Next Me.MousePointer = 11

If cmdBaru.Caption = "&Baru" Then cmdBaru.Caption = "&Batal"

Auto

txttanggal.Enabled = True txttanggal.SetFocus vEdit = False

Else Semula End If

Me.MousePointer = 1 End Sub

Sub Semula() Bersih

vEdit = False vTrans = False NotAktif

LV1.ListItems.Clear End Sub

Sub Bersih()

(46)

Dim Control

For Each Control In Me.Controls If TypeOf Control Is TextBox Then Control.text = ""

End If

If TypeOf Control Is ComboBox Then Control.text = ""

End If Next Control End Sub Sub NotAktif() Dim Control

For Each Control In Me.Controls If TypeOf Control Is TextBox Then Control.Enabled = True

End If

If TypeOf Control Is ComboBox Then Control.Enabled = True

End If Next Control End Sub

Private Sub Timer1_Timer() Databarang

End Sub

Private Sub txtjml_Change() txtsub = Val(txtjml) * Val(txthrg) End Sub

(47)

Private Sub txtjml_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then

If txtjml <> "" Then If vEdit = False Then Me.MousePointer = 11

Set Vbutir = LV1.ListItems.Add(, , LV1.ListItems.Count + 1 & ".") Vbutir.SubItems(1) = txtnopsn.text

Vbutir.SubItems(2) = Combo1.text Vbutir.SubItems(3) = txttanggal.text Vbutir.SubItems(4) = txtnmsup.text Vbutir.SubItems(5) = txtalamat.text Vbutir.SubItems(6) = Combo2.text Vbutir.SubItems(7) = txtnmbrg.text Vbutir.SubItems(8) = txtsatuan.text Vbutir.SubItems(9) = txthrg.text Vbutir.SubItems(10) = txtjml.text Vbutir.SubItems(11) = txtsub.text vTrans = True

Me.MousePointer = 1

Pesan = MsgBox("Masih Ada Barang Yang Mau Di Input...", vbQuestion + vbYesNo, "Informasi..")

If Pesan = vbYes Then

txtnmbrg = ""

txtsatuan = ""

txthrg = ""

txtjml = ""

txtsub = ""

(48)

Combo2.SetFocus Exit Sub

End If

Me.MousePointer = 1

Else

vTrans = True

If LV1.ListItems.Count > 0 Then

LV1.ListItems.Remove LV1.SelectedItem.Index For i = 1 To LV1.ListItems.Count

LV1.ListItems(i).text = i & "."

Next i End If

'txtsub.text = Val(Int(txthrg)) * Val(Int(txtjml))

Set Vbutir = LV1.ListItems.Add(, , LV1.ListItems.Count + 1 & ".") Vbutir.SubItems(1) = txtnopsn.text

Vbutir.SubItems(2) = Combo1.text Vbutir.SubItems(3) = txttanggal.text Vbutir.SubItems(4) = txtnmsup.text Vbutir.SubItems(5) = txtalamat.text Vbutir.SubItems(6) = Combo2.text Vbutir.SubItems(7) = txtnmbrg.text Vbutir.SubItems(8) = txtsatuan.text Vbutir.SubItems(9) = txthrg.text Vbutir.SubItems(10) = txtjml.text Vbutir.SubItems(11) = txtsub.text

(49)

End If End If End If End Sub

Private Sub txtTanggal_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then

daftarsupplier DaftarBarang

If Combo1.ListCount = 0 Then

MsgBox "Data supplier masih kosong..,," & vbCrLf & _ "Coba periksa kembali...", vbCritical

Unload Me Exit Sub End If

r = SendMessageLong(Combo1.hwnd, CB_SHOWDROPDOWN, True, 0)

Combo1.Enabled = True Frame1.Enabled = True End If

End Sub

Private Sub Lv1_Click()

If Not LV1.ListItems.Count = 0 Then Exit Sub

End If End Sub Sub Simpan()

'On Error GoTo salah

(50)

Me.MousePointer = 11 hackingdatabase.BeginTrans ' For i = 1 To Lv1.ListItems.Count

hackingdatabase.Execute "Insert Into Pesanan values ('" & txtnopsn.text & "',"

& _",'" & Combo1.text & "','" & txttanggal & "')"

'Next i

hackingdatabase.CommitTrans

hackingdatabase.BeginTrans For i = 1 To LV1.ListItems.Count

hackingdatabase.Execute "Insert Into Pesan values ('" & txtnopsn.text &

"'," & _

"'" & LV1.ListItems(i).SubItems(6) & "','" &

Val(LV1.ListItems(i).SubItems(9)) & "','" & Val(LV1.ListItems(i).SubItems(10))

& "')"

Next i

hackingdatabase.CommitTrans Me.MousePointer = 1

End Sub Sub Edit()

On Error GoTo salah Me.MousePointer = 11 hackingdatabase.BeginTrans For i = 1 To LV1.ListItems.Count

hackingdatabase.Execute "Update pesan Set kd_brg='" &

LV1.ListItems(i).SubItems(6) & "',Harga='" & _

(51)

LV1.ListItems(i).SubItems(9) & "',jumlah='" &

LV1.ListItems(i).SubItems(10) & "' Where [No_psn]='" & txtnopsn.text & "'"

Next i

'TMedis.BeginTrans

'For i = 1 To LV1.ListItems.Count

'hackingdatabase.Execute "Update Dosis set resep ='" &

LV1.ListItems(i).SubItems(8) & "' Where [No medis]='" & txtNomor.text & "'"

'Next i

hackingdatabase.CommitTrans Me.MousePointer = 1

Exit Sub salah:

MsgBox "Data tidak bisa di edit, ada kesalahan..", vbInformation End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Index

Case 1 baru Case 2

Me.MousePointer = 11 If Not vEdit Then Simpan

Else 'Edit End If Semula

(52)

Case 3 Unload Me End Select End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) On Error Resume Next

Do Until Me.Top <= -5000 DoEvents

Me.Move Me.Left, Me.Top - 15 DoEvents

Loop Unload Me End Sub

Cetak Pesanan Sub cetakpesanan()

Set rsqisilaporan = New ADODB.Recordset

SQL = "select * from Qisilaporan where No_pesanan='" & Combo1 & "'"

Set rsqisilaporan = hackingdatabase.Execute(SQL) saring = "{Qisilaporan.No_pesanan}='" & Combo1 & "'"

With CR

.DataFiles(0) = App.Path & "\Pembelian.mdb"

.ReportFileName = App.Path + "\pesanan.rpt"

.Destination = crptToWindow .WindowState = crptMaximized .ReplaceSelectionFormula (saring) .Action = 1

End With End Sub

(53)

Private Sub Cmdcetak_Click() Call cetakpesanan

End Sub

Private Sub Combo1_Click() If Combo1.text <> "" Then 'daftardatapesanan

Me.MousePointer = 11

Kata = "Select * from pesanan where [no_pesanan]='" & Combo1.text &

"'"

Set TQisilaporan = New ADODB.Recordset

TQisilaporan.Open Kata, hackingdatabase, adOpenDynamic If TQisilaporan.EOF Then

TQisilaporan.Close

Set TQisilaporan = Nothing Me.MousePointer = 1

MsgBox "No Pesanan = & " & Combo1.text & " tidak terdaftar...", vbInformation

Combo1.SetFocus Exit Sub

End If

TQisilaporan.Close

Set TQisilaporan = Nothing Me.MousePointer = 1

End If End Sub

Sub daftardatapesanan()

(54)

Me.MousePointer = 11

Kata = "Select * from pesanan Order By [no_pesanan]"

Set TQisilaporan = New ADODB.Recordset

TQisilaporan.Open Kata, hackingdatabase, adOpenDynamic, adLockOptimistic

Combo1.Clear

If Not TQisilaporan.EOF Then TQisilaporan.MoveFirst While Not TQisilaporan.EOF

Combo1.AddItem TQisilaporan![No_pesanan]

TQisilaporan.MoveNext Wend

End If

TQisilaporan.Close

Set TQisilaporan = Nothing Me.MousePointer = 1 End Sub

Private Sub Form_Load() Ketengah Me

daftardatapesanan End Sub

Laporan

Dim RsQLapPembelian As New ADODB.Recordset Private Sub Cmdkeluar_Click()

Unload Me End Sub

Private Sub Form_Load()

(55)

koneksi

Set RsQLapPembelian = New ADODB.Recordset

RsQLapPembelian.Open " select * from QLaporanpembelian ", hackingdatabase, adOpenDynamic, adLockOptimistic

DTPicker1 = Format(Now, "dd-mm-yyyy") DTPicker2 = Format(Now, "dd-mm-yyyy") End Sub

Private Sub Form_Unload(Cancel As Integer) On Error Resume Next

Do Until Me.Top <= -5000 DoEvents

Me.Move Me.Left, Me.Top - 10 DoEvents

Loop Unload Me End Sub

Private Sub Cmdlayar_Click()

RsQLapPembelian.Filter = " Tgl_pesanan >= '" & DTPicker1.Value & "' AND tgl_pesanan <= '" & DTPicker2.Value & "'"

If DTPicker2.Value < DTPicker1.Value Then

MsgBox " Tanggal Akhir Harus Lebih Besar dari Tanggal Awal...!", vbOKOnly + vbInformation, "WARNING..."

ElseIf RsQLapPembelian.EOF Then

(56)

MsgBox " Transaksi Dari Tanggal : " & DTPicker1.Value & " s/d " &

DTPicker2.Value & " Tidak Ada ", vbInformation, "Honny...!"

Else

CR.ReportFileName = "" & App.Path & "\Laporan.RPT"

CR.SelectionFormula = " {QLaporanpembelian.Tgl_pesanan}>=#" &

Format(DTPicker1.Value, "M/D/YY") & _

"# AND {QLaporanpembelian.Tgl_pesanan} <=#" &

Format(DTPicker2.Value, "M/D/YY") & "#"

CR.Formulas(1) = "TglAwal='" & Format(DTPicker1.Value,

"DD/MM/YYYY") & "'"

CR.Formulas(2) = "TglAkhir='" & Format(DTPicker2.Value,

"DD/MM/YYYY") & "'"

CR.WindowState = crptMaximized CR.RetrieveDataFiles

CR.Action = 1 End If

End Sub

Referensi

Dokumen terkait

Private Sub tkd_casis_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then.. tnm_casis.SetFocus

Selain dengan mengamati benda-benda (contoh sumber daya alam yang tidak dapat diperbaharui) yang telah disajikan diawal pembelajaran, setiap anggota kelompok

Private Sub TKdSup_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))). If KeyAscii = 13 Then TNmSup.SetFocus

Lampiran C-2 Rancangan Nota

Baru Pasir Padi Ketapang Pangkalbalam Pangkalpinang Telp/Fax : (0717) 438936. Bersama ini kami serahkan barang – barang sebagai

MASUKAN SISTEM BERJALAN.. Lampiran B-1 Data Barang.. Lampiran B-2 Data Supplier.. Lampiran B-3 Nota Pembelian.. Lampiran B-4 Surat Jalan.. LAMPIRAN E. SURAT KETERANGAN

Keluaran Sistem Berjalan Laporan Pembelian Barang... 100 Lampiran

MsgBox &#34;Nomor Urut : &#34; &amp; Text2 &amp; &#34; Tidak Ada Pada Database!&#34;, vbInformation, &#34;Info&#34;. Text3