Tugas VB lanjutan.docx
-
Upload
muhammad-irsyad -
Category
Documents
-
view
226 -
download
0
Transcript of Tugas VB lanjutan.docx
-
8/19/2019 Tugas VB lanjutan.docx
1/20
Tugas VB lanjutan : Penjualan Mobil secara Kredit
Diposkan oleh ali murtado on Rabu, 08 Juni 2011
1.
Tugas VB Lanjutan : Penjualan Mobil Secara Kredit
Langkah awal pebuatan adalah ebuat database enggunakan !cces" #an
enoralisasin$a
Spesi%kasi
Tabel Mobil
Field Name Data Type File Size Description
Kd_mobil Text 30 Primary key
Merk_Mobil Text 30
Hara_ Mobil !"rrencyDP !"rrency
!icilan Text
Tabel &ustoer
Field Name Data Type File Size Description
kd_c"st Text #0 Primary key
nama_c"st Text 30
No_Telp Text 30
Peker$aan Text 30
Tabel 'aktur
Field Name Data Type File Size Description
No_Kredit Text #0 Primary key
Tl Date%Time
Kd_!"st Text 30
&d Text 30
Nama_Kasir Text 30
Tabel Kasir
Field Name Data Type File Size Description
&d Text #0 Primary key
Nama Text 30
Pas''ord Text #0
http://ali-murtado.blogspot.co.id/2011/06/tugas-vb-lanjutan-penjualan-mobil.htmlhttp://ali-murtado.blogspot.co.id/2011/06/tugas-vb-lanjutan-penjualan-mobil.html
-
8/19/2019 Tugas VB lanjutan.docx
2/20
Tabel Kredit
Field Nama Data Type File Size Description
No_Kredit Text #0
Kd_c"st Text #0
Kd_mobil Text #0
Hara !"rrency
!icilan !"rrency
DP !"rrency
("na !"rrency
!icilan_("la
n
Text #0
Berikut bentuk noralisasin$a.
Ketentuan :
1. (ika Laa cicilan 1) Bulan" Maka
Bunga: 1)* #ari +arga obil
&icilan: ,,+arga-#P/Bunga01
. (ika Laa cicilan ) Bulan" Maka
Bunga: 12* #ari +arga obil
&icilan: ,,+arga-#P/Bunga01
3. (ika Laa cicilan 3) Bulan" Maka
-
8/19/2019 Tugas VB lanjutan.docx
3/20
Bunga)* #ari +arga obil
&icilan: ,,+arga-#P/Bunga01
4. (ika Laa cicilan 4) Bulan" Maka
Bunga:2* #ari +arga obil
&icilan: ,,+arga-#P/Bunga01
5ancangan 'or" Laporan dan Menu 6taa
'or Login
'or Login
Listing Progra :
Pri7ate Sub cdlogin8&lick,
adologin.5ecordSource 9 select password ;ro kasir
adologin.5e;resh
-
8/19/2019 Tugas VB lanjutan.docx
4/20
Tri,tuser > =
@; adologin.5ecordset.A' Then
MsgBo? 6ser id anda salah" 7b&ritical / 7bCesDo" @n;o
tuser 9
tuser.Set'ocus
Alse
tnser.Te?t 9 adologin.5ecordset.'ields,naa
tnser.Anabled 9 'alse
t?tpass.Set'ocus
And @;
And @;
And Sub
b. 'or Mobil
-
8/19/2019 Tugas VB lanjutan.docx
5/20
Listing Progra :
Dim isibrg As Boolean
Pri7ate Sub cdadd8&lick,
akti;
bersih
Te?t1.Set'ocus
And Sub
Pri7ate Sub cdcancel8&lick,
awal
And Sub
Pri7ate Sub cdcari8&lick,
adojual.5ecordSource 9 selectE;ro obil where kd8obil9= > Te?tF > =
adojual.5e;resh
-
8/19/2019 Tugas VB lanjutan.docx
6/20
@; .Page&ount GH ) Then
adojual.5e;resh
Te?tF 9
Te?tF.Set'ocus
&all tapil
Alse
MsgBo? kode / Te?tI / Tidak !da" 34" @n;o
Te?tF 9
Te?tF.Set'ocus
adojual.5ecordSource 9 selectE;ro obil
adojual.5e;resh
And @;
And
-
8/19/2019 Tugas VB lanjutan.docx
7/20
Te?t1.Anabled 9 'alse
Te?t.Set'ocus
And Sub
Pri7ate Sub cdlast8&lick,
adojual.5ecordset.Mo7eLast
tapil
And Sub
Pri7ate Sub cdne?t8&lick,
adojual.5ecordset.Mo7eDe?t
@; adojual.5ecordset.A' Then
MsgBo? #ata Sudah #i !khir 5ecord" 4J" @n;o
adojual.5ecordset.Mo7eLast
And @;
tapil
And Sub
Pri7ate Sub cdpre78&lick,
adojual.5ecordset.Mo7ePre7ious
@; adojual.5ecordset.B' Then
MsgBo? #ata Sudah #i !wal 5ecord" 4J" @n;o
adojual.5ecordset.Mo7e'irst
And @;
tapil
And Sub
Pri7ate Sub cdsa7e8&lick,
-
8/19/2019 Tugas VB lanjutan.docx
8/20
.'ields,Do8Kredit 9 #ata&obo4.Te?t
.'ields,kd8cust 9 #ata&obo.Te?t
.'ields,kd8obil 9 #ata&obo3.Te?t
.'ields,+arga 9 Val,Te?tJ.Te?t
.'ields,&icilan 9 &obo1.Te?t
.'ields,#P 9 Val,Te?t.Te?t
.'ields,Bunga 9 Val,Te?t1).Te?t
.'ields,Laa8cicilan 9 Val,Te?t11.Te?t
.6pdate
And @;
And
-
8/19/2019 Tugas VB lanjutan.docx
9/20
Te?t1 9
Te?t 9
Te?t3 9
Te?t4 9
And Sub
Sub akti;,
Te?t1.Anabled 9 True
Te?t.Anabled 9 True
Te?t3.Anabled 9 True
Te?t4.Anabled 9 True
And Sub
Sub tapil,
Te?t1.Te?t 9 adojual.5ecordset.'ields,kd8obil
Te?t.Te?t 9 adojual.5ecordset.'ields,erk8obil
Te?t3.Te?t 9 adojual.5ecordset.'ields,harga8obil
Te?t4.Te?t 9 adojual.5ecordset.'ields,#P
And Sub
Pri7ate Sub Te?tI8&hange,
adojual.5ecordSource 9 selectE;ro obil where erk8obil like=* > Te?tI > *=
adojual.5e;resh
And Sub
c. 'or Kasir
-
8/19/2019 Tugas VB lanjutan.docx
10/20
Listing Program :
#i isikasir !s Boolean
Pri7ate Sub cdadd8&lick,
akti;
bersih
Te?t1.Set'ocus
And Sub
Pri7ate Sub cdcancel8&lick,
awal
And Sub
Pri7ate Sub cddelete8&lick,
@; Len,Tri,Te?t1.Te?t 9 Then
A?it Sub
And @;
p 9 MsgBo?,Benar Mau #ihapus" 3 / 4" Tan$a
@; p 9 7bCes Then
adokasir.5ecordset.#elete
adokasir.5e;resh
bersih
awal
Alse
awal
And @;
And Sub
Pri7ate Sub cdedit8&lick,
isikasir 9 'alse
akti;
Te?t1.Anabled 9 'alse
Te?t.Set'ocus
And Sub
-
8/19/2019 Tugas VB lanjutan.docx
11/20
Pri7ate Sub cdlast8&lick,
adokasir.5ecordset.Mo7eLast
tapil
And Sub
Pri7ate Sub cdne?t8&lick,
adokasir.5ecordset.Mo7eDe?t
@; adokasir.5ecordset.A' Then
MsgBo? #ata Sudah #i !khir 5ecord" 4J" @n;o
adokasir.5ecordset.Mo7eLast
And @;
tapil
And Sub
Pri7ate Sub cdpre78&lick,
adokasir.5ecordset.Mo7ePre7ious
@; adokasir.5ecordset.B' Then
MsgBo? #ata Sudah #i !wal 5ecord" 4J" @n;o
adokasir.5ecordset.Mo7e'irst
And @;
tapil
And Sub
Pri7ate Sub cdsa7e8&lick,
-
8/19/2019 Tugas VB lanjutan.docx
12/20
cdcancel8&lick
And Sub
Pri7ate Sub cdtop8&lick,
adokasir.5ecordset.Mo7e'irst
tapil
And Sub
Pri7ate Sub 'or8!cti7ate,
awal
tapil
isikasir 9 True
And Sub
Sub awal,
adokasir.5ecordSource 9 selectE;ro kasir
adokasir.5e;resh
Te?t1.Anabled 9 'alse
Te?t.Anabled 9 'alse
Te?t3.Anabled 9 'alse
And Sub
Sub bersih,
Te?t1 9
Te?t 9
Te?t3 9
And Sub
Sub akti;,
Te?t1.Anabled 9 True
Te?t.Anabled 9 True
Te?t3.Anabled 9 True
And Sub
Sub tapil,
Te?t1.Te?t 9 adokasir.5ecordset.'ields,@#
Te?t.Te?t 9 adokasir.5ecordset.'ields,naa
Te?t3.Te?t 9 adokasir.5ecordset.'ields,password
And Sub
d. Kredit
-
8/19/2019 Tugas VB lanjutan.docx
13/20
Listing Program :
#i isi !s Boolean
Sub bersih,
Te?t1 9
Te?t3 9
Te?t4 9
Te?t2 9
Te?tF 9
Te?tI 9
Te?tJ 9
Te?t 9
Te?t1) 9
Te?t11 9
-
8/19/2019 Tugas VB lanjutan.docx
14/20
And Sub
Sub non,
Te?t1.Anabled 9 'alse
Te?t.Anabled 9 'alse
Te?t3.Anabled 9 'alse
Te?t4.Anabled 9 'alse
Te?t2.Anabled 9 'alse
Te?tF.Anabled 9 'alse
Te?tI.Anabled 9 'alse
Te?tJ.Anabled 9 'alse
Te?t.Anabled 9 'alse
Te?t1).Anabled 9 'alse
Te?t11.Anabled 9 'alse
And Sub
Sub akti;,
Te?t1.Anabled 9 True
Te?t.Anabled 9 True
Te?t3.Anabled 9 True
Te?t4.Anabled 9 True
Te?t2.Anabled 9 True
Te?tF.Anabled 9 True
Te?tI.Anabled 9 True
Te?tJ.Anabled 9 True
Te?t.Anabled 9 True
Te?t1).Anabled 9 True
Te?t11.Anabled 9 True
And Sub
Sub no,
#i urutan !s String
#i hitung !s Long
adokredit.5ecordSource 9 select E ;ro ;aktur
adokredit.5e;resh
@; adokredit.5ecordset.5ecord&ount G9 ) Then
urutan 9 adokredit.5ecordset.5ecord&ount / 1
Te?t1.Te?t 9 ' / 'orat,#ate" $$ / 'orat,urutan" ))))
Alse
adokredit.5ecordset.Mo7eLast
urutan 9 Val,5ight,adokredit.5ecordsetno8kredit" 3 / 1
Te?t1.Te?t 9 P / 'orat,#ate" $$ / 'orat,urutan" ))))
And @; And Sub
-
8/19/2019 Tugas VB lanjutan.docx
15/20
Pri7ate Sub cdadd8&lick,
bersih
#ata&obo4.Set'ocus
And Sub
Pri7ate Sub cdcancel8&lick,
And Sub
Pri7ate Sub cde?it8&lick,
And
And Sub
Pri7ate Sub cdsa7e8&lick,
n Arror 5esue De?t
-
8/19/2019 Tugas VB lanjutan.docx
16/20
@; &obo1.Te?t 9 3) Bulan Then
Te?t1).Te?t 9 Val,Te?tJ E ).1
Te?t11.Te?t 9 ,,Val,Te?tJ.Te?t - Val,Te?t.Te?t / Val,Te?t1).Te?t 0 3)
Alse
Te?t1).Te?t 9 Val,Te?tJ E ).1
Te?t11.Te?t 9 ,,Val,Te?tJ.Te?t - Val,Te?t.Te?t / Val,Te?t1).Te?t 0 4)
And @;
And @;
And @;
cdsa7e.Anabled 9 True
And Sub
Pri7ate Sub #ata&obo8&lick,!rea !s @nteger
adocust.5ecordSource 9 select E ;ro custoer where kd8cust9 = > datacobo >
=
adocust.5ecordset.Mo7e'irst
#o datacobo3 > =
adojual.5ecordset.Mo7e'irst
#o
-
8/19/2019 Tugas VB lanjutan.docx
17/20
And @;
adojual.5ecordset.Mo7eDe?t
&obo1.Set'ocus
Loop
And Sub
Pri7ate Sub #ata&obo48&lick,!rea !s @nteger
ado;aktur.5ecordSource 9 select E ;ro ;aktur where no8kredit9 = > datacobo4 >
=
ado;aktur.5ecordset.Mo7e'irst
#o
-
8/19/2019 Tugas VB lanjutan.docx
18/20
-
8/19/2019 Tugas VB lanjutan.docx
19/20
'or Menu 6taa
-
8/19/2019 Tugas VB lanjutan.docx
20/20