Anda di halaman 1dari 12

Di Susun Oleh

Agus Muhardi, A.Md

Jurusan Komputerisasi Akuntansi dan Manajeman Informatika


BINA SARANA INFORMATIKA DAN KOMPUTER
Tangerang 2005
Kunci Jawaban Soal Latihan Pra UAS Tipe A

Objek-objek yang terkait:


Objeck Properties Nilai
Form1 Caption Alga Musa
Data1 Name Toko
Caption Data Toko
Database Name Cari Difolder Masing2
Recordset Type 0-Table
Record Source 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 Txtnama
DataSource Toko
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text2 Name Txtharga
DataSource Toko
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text3 Name Txtjumlah
DataSource Toko
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text4 Name Txtbayar
DataSource Toko
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text5 Name Txtpot
DataSource Toko
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text6 Name Txttotal
DataSource Toko
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>

2
Frame1 Caption Tombol Operasi
CommandButton1 Name Cmdadd
Caption &ADD
CommandButton2 Name Cmdcancel
Caption &CANCEL
CommandButton3 Name Cmdsave
Caption &SAVE
CommandButton4 Name Cmdhitung
Caption &HITUNG
CommandButton5 Name Cmdexit
Caption E&XIT
Dbgrid1 Caption DATA TRANSAKSI
DataSource 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 txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Private Sub cmdsave_Click() cmdhitung.SetFocus
If tambah = True Then End If
toko.Recordset.Update End Sub
Else
toko.Recordset.Update Private Sub txtnama_KeyPress(KeyAscii As Integer)
End If KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub If KeyAscii = 13 Then
Private Sub Form_Load() txtharga.SetFocus
tambah = False End If
End Sub End Sub

Private Sub txtharga_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
txtjumlah.SetFocus
End If
End Sub

3
Kunci Jawaban Soal Latihan Pra UAS Tipe B

Objek-objek yang terkait :


Objeck Properties Nilai
Form1 Caption Alga Musa
Data1 Name Data1
Caption Data Musik
Database Name Cari Difolder Masing2
Recordset Type 0-Table
Record Source Tbl_Musik
Data2 Name Data2
Caption Data Film
Database Name Cari Difolder Masing2
Recordset Type 1-Dynaset
Record Source Tbl_Film
Label1 Caption Toko VCD Alga Musa
Frame1 Caption Musik
Label2 Caption Jenis Musik
Label3 Caption Harga
Label4 Caption Jumlah Beli
Text1 Name Text1
DataSource Data1
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text2 Name Text2
DataSource Data1
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text3 Name Text3
DataSource Data1
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Frame2 Caption Film
Label5 Caption Jenis Film
Label6 Caption Harga
Label7 Caption Jumlah Beli
Text4 Name Text4
DataSource Data2
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>

4
Text5 Name Text5
DataSource Data2
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text6 Name Text6
DataSource Data2
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
CommandButton1 Name Cmdback
Caption BACK
CommandButton2 Name Cmdnext
Caption NEXT
CommandButton3 Name Cmdcarimusik
Caption CARI JENIS MUSIK
CommandButton4 Name Cmdback1
Caption BACK
CommandButton5 Name Cmdnext1
Caption NEXT
CommandButton6 Name Cmdcarifilm
Caption CARI JENIS FILM
Frame3 Caption Transaksi Pembayaran
Label8 Caption Total Bayar
Label9 Caption Uang Bayar
Label10 Caption Uang Kembali
Text7 Name Text7
Text <Kosongkan>
Text8 Name Text8
Text <Kosongkan>
Text9 Name Text9
Text <Kosongkan>
CommandButton8 Name Cmdhitung
Caption HITUNG
CommandButton9 Name Cmdkeluar
Caption 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

5
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

6
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 Data1
Caption Data Makan
Database Name Cari Difolder Masing2
Recordset Type 0-Table
Record Source Tbl_Makan
Data2 Name Data2
Caption Data Minum
Database Name Cari Difolder Masing2
Recordset Type 0-Table
Record Source Tbl_Minum
Dbgrid1 Caption Menu Pempek
DataSource Data1
Dbgrid2 Caption Menu Minuman
DataSource Data2
Frame1 Caption Pesanan Pempek
Label2 Caption Nama Makanan
Label3 Caption Harga
Label4 Caption Jumlah Porsi
Text1 Name Text1
DataSource Data1
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text2 Name Text2
DataSource Data1
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text3 Name Text3
DataSource Data1
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>

7
Frame2 Caption Pesanan Minuman
Label5 Caption Nama Minuman
Label6 Caption Harga
Label7 Caption Jumlah Porsi
Text4 Name Text4
DataSource Data2
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text5 Name Text5
DataSource Data2
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text6 Name Text6
DataSource Data2
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Frame3 Caption Data Transaksi
Label8 Caption Total Bayar
Label9 Caption Uang Bayar
Label10 Caption Kembali
Text7 Name Text7
Text <Kosongkan>
Text8 Name Text8
Text <Kosongkan>
Text9 Name Text9
Text <Kosongkan>
CommandButton8 Name Cmdhitung
Caption HITUNG
CommandButton9 Name Cmdkeluar
Caption 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

8
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 Motor
Caption Data Motor
Database Name Cari Difolder Masing2
Recordset Type 0-Table
Record Source 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

9
Text1 Name txtjenis
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text2 Name txtharga
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text3 Name txtjumlah
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text4 Name txtbayar
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text5 Name txtpotong
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text6 Name txttotal
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
CommandButton1 Name Cmdtambah
Caption TAMBAH
CommandButton2 Name Cmdsimpan
Caption SIMPAN
CommandButton3 Name Cmdbatal
Caption BATAL
CommandButton4 Name Cmdhitung
Caption HITUNG
CommandButton5 Name Cmdkeluar
Caption KELUAR
Dbgrid1 Caption DATA TRANSAKSI
DataSource 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

10
Private Sub cmdsimpan_Click() Private Sub Option2_Click()
If tambah = True Then txtjenis.Text = "Karisma"
motor.Recordset.Update txtharga.Text = 8500000
Else txtjumlah.SetFocus
motor.Recordset.Update Option1.Value = False
End If Option3.Value = False
End Sub Option4.Value = False
Option5.Value = False
Private Sub cmdtambah_Click() Option6.Value = False
tambah = True Option7.Value = False
motor.Recordset.AddNew Option9.Value = False
txtjenis.SetFocus Option10.Value = False
End Sub Option11.Value = False
End Sub
Private Sub Form_Load()
tambah = False Private Sub Option3_Click()
Option1.Value = False txtjenis.Text = "Lagenda"
Option2.Value = False txtharga.Text = 8560000
Option3.Value = False txtjumlah.SetFocus
Option4.Value = False Option1.Value = False
Option5.Value = False Option2.Value = False
Option6.Value = False Option4.Value = False
Option7.Value = False Option5.Value = False
Option9.Value = False Option6.Value = False
Option10.Value = False Option7.Value = False
Option11.Value = False Option9.Value = False
End Sub Option10.Value = False
Option11.Value = False
Private Sub Option1_Click() End Sub
txtjenis.Text = "Supra"
txtharga.Text = 8000000 Private Sub Option4_Click()
txtjumlah.SetFocus txtjenis.Text = "Honda Win"
Option2.Value = False txtharga.Text = 7500000
Option3.Value = False txtjumlah.SetFocus
Option4.Value = False Option1.Value = False
Option5.Value = False Option2.Value = False
Option6.Value = False Option3.Value = False
Option7.Value = False Option5.Value = False
Option9.Value = False Option6.Value = False
Option10.Value = False Option7.Value = False
Option11.Value = False Option9.Value = False
End Sub Option10.Value = False
Option11.Value = False
Private Sub Option10_Click() End Sub
txtjenis.Text = "Jupiter"
txtharga.Text = 10000000 Private Sub Option5_Click()
txtjumlah.SetFocus txtjenis.Text = "Smesh"
Option1.Value = False txtharga.Text = 6500000
Option2.Value = False txtjumlah.SetFocus
Option3.Value = False Option1.Value = False
Option4.Value = False Option2.Value = False
Option5.Value = False Option3.Value = False
Option6.Value = False Option4.Value = False
Option7.Value = False Option6.Value = False
Option9.Value = False Option7.Value = False
Option11.Value = False Option9.Value = False
End Sub Option10.Value = False
Option11.Value = False
Private Sub Option11_Click() End Sub
txtjenis.Text = "RX King"
txtharga.Text = 15000000 Private Sub Option6_Click()
txtjumlah.SetFocus txtjenis.Text = "Sohgon"
Option1.Value = False txtharga.Text = 7800000
Option2.Value = False txtjumlah.SetFocus
Option3.Value = False Option1.Value = False
Option4.Value = False Option2.Value = False
Option5.Value = False Option3.Value = False
Option6.Value = False Option4.Value = False
Option7.Value = False Option5.Value = False
Option9.Value = False Option7.Value = False
Option10.Value = False Option9.Value = False
End Sub Option10.Value = False
Option11.Value = False
End Sub

11
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

12