Web & Social Media Analytics Previous Year Question Paper.pdf
31706341 latihan-vb-step-by-step
1. Di Susun Oleh
Agus Muhardi, A.Md
Jurusan Komputerisasi Akuntansi dan Manajeman Informatika
BINA SARANA INFORMATIKA DAN KOMPUTER
Tangerang 2005
2. 2
Kunci Jawaban Soal Latihan Pra UAS Tipe A
Objek-objek yang terkait:
Objeck Properties Nilai
Form1 Caption Alga Musa
Data1 Name
Caption
Database Name
Recordset Type
Record Source
Toko
Data Toko
Cari Difolder Masing2
0-Table
Tbl_Toko
Label1 Caption Toko Alat Tulis Alga Musa
Label2 Caption Nama Barang
Label3 Caption Harga Barang
Label4 Caption Jumlah Barang
Label5 Caption Bayar
Label6 Caption Potongan
Label7 Caption Total Bayar
Text1 Name
DataSource
DataField
Text
Txtnama
Toko
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text2 Name
DataSource
DataField
Text
Txtharga
Toko
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text3 Name
DataSource
DataField
Text
Txtjumlah
Toko
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text4 Name
DataSource
DataField
Text
Txtbayar
Toko
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text5 Name
DataSource
DataField
Text
Txtpot
Toko
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text6 Name
DataSource
DataField
Text
Txttotal
Toko
Sesuaikan dengan fieldnya masing2
<Kosongkan>
3. 3
Frame1 Caption Tombol Operasi
CommandButton1 Name
Caption
Cmdadd
&ADD
CommandButton2 Name
Caption
Cmdcancel
&CANCEL
CommandButton3 Name
Caption
Cmdsave
&SAVE
CommandButton4 Name
Caption
Cmdhitung
&HITUNG
CommandButton5 Name
Caption
Cmdexit
E&XIT
Dbgrid1 Caption
DataSource
DATA TRANSAKSI
Toko
Listing Programnya:
Private Sub cmdadd_Click()
tambah = True
toko.Recordset.AddNew
txtnama.SetFocus
End Sub
Private Sub cmdcancel_Click()
toko.Recordset.CancelUpdate
toko.Recordset.MoveLast
End Sub
Private Sub cmdexit_Click()
psn = MsgBox("Anda Yakin Ingin Keluar", 32 + 4, "Informasi")
If psn = vbYes Then
MsgBox "Makasih Yach.........", 32, "informasi"
End
Else
If psn = vbNo Then
MsgBox "Lho.....kok enggak jadi toh", 32, "Informasi"
End If
End If
End Sub
Private Sub cmdlagi_Click()
dbbio.Recordset.MoveNext
If dbbio.Recordset.EOF Then
dbbio.Recordset.MoveLast
MsgBox "Sudah Diakhir Reocrd Adek...Sayang", 16, "Informasi"
End If
End Sub
Private Sub cmdhitung_Click()
txtbayar.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
If txtjumlah > 5 Then
txtpot.Text = 2 / 100 * Val(txtbayar.Text)
txttotal.Text = Val(txtbayar.Text) - Val(txtpot.Text)
Else
txtpot.Text = 0
txttotal = Val(txtbayar.Text) - Val(txtpot.Text)
End If
End Sub
Private Sub cmdsave_Click()
If tambah = True Then
toko.Recordset.Update
Else
toko.Recordset.Update
End If
End Sub
Private Sub Form_Load()
tambah = False
End Sub
Private Sub txtharga_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtjumlah.SetFocus
End If
End Sub
Private Sub txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
txtharga.SetFocus
End If
End Sub
4. 4
Kunci Jawaban Soal Latihan Pra UAS Tipe B
Objek-objek yang terkait :
Objeck Properties Nilai
Form1 Caption Alga Musa
Data1 Name
Caption
Database Name
Recordset Type
Record Source
Data1
Data Musik
Cari Difolder Masing2
0-Table
Tbl_Musik
Data2 Name
Caption
Database Name
Recordset Type
Record Source
Data2
Data Film
Cari Difolder Masing2
1-Dynaset
Tbl_Film
Label1 Caption Toko VCD Alga Musa
Frame1 Caption Musik
Label2 Caption Jenis Musik
Label3 Caption Harga
Label4 Caption Jumlah Beli
Text1 Name
DataSource
DataField
Text
Text1
Data1
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text2 Name
DataSource
DataField
Text
Text2
Data1
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text3 Name
DataSource
DataField
Text
Text3
Data1
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Frame2 Caption Film
Label5 Caption Jenis Film
Label6 Caption Harga
Label7 Caption Jumlah Beli
Text4 Name
DataSource
DataField
Text
Text4
Data2
Sesuaikan dengan fieldnya masing2
<Kosongkan>
5. 5
Text5 Name
DataSource
DataField
Text
Text5
Data2
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text6 Name
DataSource
DataField
Text
Text6
Data2
Sesuaikan dengan fieldnya masing2
<Kosongkan>
CommandButton1 Name
Caption
Cmdback
BACK
CommandButton2 Name
Caption
Cmdnext
NEXT
CommandButton3 Name
Caption
Cmdcarimusik
CARI JENIS MUSIK
CommandButton4 Name
Caption
Cmdback1
BACK
CommandButton5 Name
Caption
Cmdnext1
NEXT
CommandButton6 Name
Caption
Cmdcarifilm
CARI JENIS FILM
Frame3 Caption Transaksi Pembayaran
Label8 Caption Total Bayar
Label9 Caption Uang Bayar
Label10 Caption Uang Kembali
Text7 Name
Text
Text7
<Kosongkan>
Text8 Name
Text
Text8
<Kosongkan>
Text9 Name
Text
Text9
<Kosongkan>
CommandButton8 Name
Caption
Cmdhitung
HITUNG
CommandButton9 Name
Caption
Cmdkeluar
KELUAR
Listing Programnya:
Dim bayar As Long
Private Sub cmdback_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
MsgBox "Sudah Diawal Record Adek", "16", "Informasi"
End If
End Sub
Private Sub cmdcarifilm_Click()
Dim soraya As String * 5
Dim lusiana As String
soraya = InputBox("Ketik Kode Musik:", "Pencarian Biodata")
lusiana = "kd_film ='" & soraya & "'"
Data2.Recordset.FindFirst lusiana
If Data2.Recordset.NoMatch Then
MsgBox "Maaf Mas Kode Musik " + soraya + " tidk ada", 16, "informasi"
Data2.Recordset.MoveFirst
End If
End Sub
Private Sub cmdcarimusuk_Click()
Dim soraya As String * 5
soraya = InputBox("Ketik Kode Musik:", "Pencarian Biodata")
alga_musa = "kd_musik '" & soraya & "'"
Data1.Recordset.Index = "kdmusik"
Data1.Recordset.Seek "=", soraya
If Data1.Recordset.NoMatch Then
MsgBox "Maaf Mas Kode Musik " + soraya + " tidk ada", 16, "informasi"
Data1.Recordset.MoveFirst
End If
End Sub
6. 6
Private Sub cmdhitung_Click()
bayar = Val(Text2.Text) * Val(Text3.Text) + Val(Text5.Text) * Val(Text6.Text)
Text7 = Format(bayar, " Rp ###,###,###") & ",-"
End Sub
Private Sub cmdkeluar_Click()
psn = MsgBox("Anda Yakin Ingin Keluar", 32 + 4, "Informasi")
If psn = vbYes Then
MsgBox "Makasih Yach.........", 32, "informasi"
End
Else
If psn = vbNo Then
MsgBox "Lho.....kok enggak jadi toh", 32, "Informasi"
End If
End If
End Sub
Private Sub cmdnext_Click()
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
MsgBox "Sudah Diakhir Reocrd Adek...Sayang", 16, "Informasi"
End If
End Sub
Private Sub cmdnext1_Click()
Data2.Recordset.MoveNext
If Data2.Recordset.EOF Then
Data2.Recordset.MoveLast
MsgBox "Sudah Diakhir Reocrd Adek...Sayang", 16, "Informasi"
End If
End Sub
Private Sub cmdback1_Click()
Data2.Recordset.MovePrevious
If Data2.Recordset.BOF Then
Data2.Recordset.MoveFirst
MsgBox "Sudah Diawal Record Adek", "16", "Informasi"
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub
Private Sub Text8_Change()
On Error Resume Next
Text9.Text = Format(Text8.Text - bayar, " Rp ###,###,###") & ",-"
End Sub
7. 7
Kunci Jawaban Soal Latihan Pra UAS Tipe C
Objek-objek yang terkait :
Objeck Properties Nilai
Form1 Caption Alga Musa
Label1 Caption Café Alga Musa
Data1 Name
Caption
Database Name
Recordset Type
Record Source
Data1
Data Makan
Cari Difolder Masing2
0-Table
Tbl_Makan
Data2 Name
Caption
Database Name
Recordset Type
Record Source
Data2
Data Minum
Cari Difolder Masing2
0-Table
Tbl_Minum
Dbgrid1 Caption
DataSource
Menu Pempek
Data1
Dbgrid2 Caption
DataSource
Menu Minuman
Data2
Frame1 Caption Pesanan Pempek
Label2 Caption Nama Makanan
Label3 Caption Harga
Label4 Caption Jumlah Porsi
Text1 Name
DataSource
DataField
Text
Text1
Data1
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text2 Name
DataSource
DataField
Text
Text2
Data1
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text3 Name
DataSource
DataField
Text
Text3
Data1
Sesuaikan dengan fieldnya masing2
<Kosongkan>
8. 8
Frame2 Caption Pesanan Minuman
Label5 Caption Nama Minuman
Label6 Caption Harga
Label7 Caption Jumlah Porsi
Text4 Name
DataSource
DataField
Text
Text4
Data2
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text5 Name
DataSource
DataField
Text
Text5
Data2
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text6 Name
DataSource
DataField
Text
Text6
Data2
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Frame3 Caption Data Transaksi
Label8 Caption Total Bayar
Label9 Caption Uang Bayar
Label10 Caption Kembali
Text7 Name
Text
Text7
<Kosongkan>
Text8 Name
Text
Text8
<Kosongkan>
Text9 Name
Text
Text9
<Kosongkan>
CommandButton8 Name
Caption
Cmdhitung
HITUNG
CommandButton9 Name
Caption
Cmdkeluar
KELUAR
Listing Programnya:
Private Sub cmdhitung_Click()
bayar = Val(Text2.Text) * Val(Text3.Text) + Val(Text5.Text) * Val(Text6.Text)
Text7.Text = Format(bayar, " Rp ###,###,###") & ",-"
End Sub
Private Sub cmdkeluar_Click()
psn = MsgBox("Anda Yakin Ingin Keluar", 32 + 4, "Informasi")
If psn = vbYes Then
MsgBox "Makasih Yach.........", 32, "informasi"
End
Else
If psn = vbNo Then
MsgBox "Lho.....kok enggak jadi toh", 32, "Informasi"
End If
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub
Private Sub Text8_Change()
On Error Resume Next
Text9.Text = Format(Text8.Text - bayar, " Rp ###,###,###") & ",-"
End Sub
9. 9
Kunci Jawaban Soal Latihan Pra UAS Tipe D
Objek-objek yang terkait :
Objeck Properties Nilai
Form1 Caption Alga Musa Motor
Label1 Caption Alga Musa Motor
Data1 Name
Caption
Database Name
Recordset Type
Record Source
Motor
Data Motor
Cari Difolder Masing2
0-Table
Tbl_Motor
Frame1 Caption Honda
Option1 Caption SPR
Option2 Caption KRM
Option3 Caption LGD
Option4 Caption WIN
Frame2 Caption Suzuki
Option5 Caption SMH
Option6 Caption SGN
Option7 Caption STR
Frame3 Caption Yamaha
Option8 Caption FGR
Option9 Caption JPR
Option10 Caption RXK
Frame4 Caption Data Transaksi
Label2 Caption Jenis Motor
Label3 Caption Harga Motor
Label4 Caption Jumlah Beli
Label5 Caption Bayar
Label6 Caption Potongan
Label7 Caption Total Bayar
10. 10
Text1 Name
DataSource
DataField
Text
txtjenis
Motor
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text2 Name
DataSource
DataField
Text
txtharga
Motor
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text3 Name
DataSource
DataField
Text
txtjumlah
Motor
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text4 Name
DataSource
DataField
Text
txtbayar
Motor
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text5 Name
DataSource
DataField
Text
txtpotong
Motor
Sesuaikan dengan fieldnya masing2
<Kosongkan>
Text6 Name
DataSource
DataField
Text
txttotal
Motor
Sesuaikan dengan fieldnya masing2
<Kosongkan>
CommandButton1 Name
Caption
Cmdtambah
TAMBAH
CommandButton2 Name
Caption
Cmdsimpan
SIMPAN
CommandButton3 Name
Caption
Cmdbatal
BATAL
CommandButton4 Name
Caption
Cmdhitung
HITUNG
CommandButton5 Name
Caption
Cmdkeluar
KELUAR
Dbgrid1 Caption
DataSource
DATA TRANSAKSI
Motor
Listing Programnya:
Private Sub cmdbatal_Click()
motor.Recordset.CancelUpdate
motor.Recordset.MoveLast
End Sub
Private Sub cmdhitung_Click()
txtbayar.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
If txtjumlah > 5 Then
txtpotong.Text = 2 / 100 * Val(txtbayar.Text)
txttotal.Text = Val(txtbayar.Text) - Val(txtpotong.Text)
Else
txtpotong.Text = 0
txttotal = Val(txtbayar.Text) - Val(txtpotong.Text)
End If
End Sub
Private Sub cmdkeluar_Click()
psn = MsgBox("Anda Yakin Ingin Keluar", 32 + 4, "Informasi")
If psn = vbYes Then
MsgBox "Makasih Yach.........", 32, "informasi"
End
Else
If psn = vbNo Then
MsgBox "Lho.....kok enggak jadi toh", 32, "Informasi"
End If
End If
End Sub
12. 12
Private Sub Option7_Click()
txtjenis.Text = "Satria"
txtharga.Text = 13000000
txtjumlah.SetFocus
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
Option9.Value = False
Option10.Value = False
Option11.Value = False
End Sub
Private Sub Option9_Click()
txtjenis.Text = "Vega R"
txtharga.Text = 12000000
txtjumlah.SetFocus
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
Option7.Value = False
Option10.Value = False
Option11.Value = False
End Sub
Private Sub txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub
Prakata
Puji Syukur kami ucapkan kepada Allah S.W.T yang telah
memberikan nikmat kesehatan sehingga kami mampu
menyelesaikan materi Microsoft Visula Basic ini dan ucapan
terima kasih juga kami sampaikan kepada AMIK-BSI selaku
lembaga yang telah memberikan kami pasilitas sehingga
semester 4 kami selesaikan dengan penuh gembira .
Akhir kata kami ucapkan sampai jumpa di semester
berikutnya…moga kita semua dalam selalu dalam lindungan
Yang Maha Esa.
Create : Agus Muhardi