Anda di halaman 1dari 13

Di Susun Oleh Agus Muhardi, A.

Md Jurusan Komputerisasi Akuntansi dan Manajeman Informatika BINA SARANA INFORMATIK A DAN KOMPUTER Tangerang 2005

Kunci Jawaban Soal Latihan Pra UAS Tipe A Objek-objek yang terkait: Objeck Properties Form1 Data1 Caption Name Caption Database Name Recordset Type Record Source Capt ion Caption Caption Caption Caption Caption Caption Name DataSource DataField Te xt Name DataSource DataField Text Name DataSource DataField Text Name DataSource DataField Text Name DataSource DataField Text Name DataSource DataField Text Nilai Alga Musa Toko Data Toko Cari Difolder Masing2 0-Table Tbl_Toko Toko Alat Tulis Alga Musa Nama Barang Harga Barang Jumlah Barang Bayar Potongan Total Bayar Txtn ama Toko Sesuaikan dengan fieldnya masing2 <Kosongkan> Txtharga Toko Sesuaikan d engan fieldnya masing2 <Kosongkan> Txtjumlah Toko Sesuaikan dengan fieldnya masi ng2 <Kosongkan> Txtbayar Toko Sesuaikan dengan fieldnya masing2 <Kosongkan> Txtp ot Toko Sesuaikan dengan fieldnya masing2 <Kosongkan> Txttotal Toko Sesuaikan de ngan fieldnya masing2 <Kosongkan> Label1 Label2 Label3 Label4 Label5 Label6 Label7 Text1 Text2 Text3 Text4 Text5 Text6 2

Frame1 CommandButton1 CommandButton2 CommandButton3 CommandButton4 CommandButton 5 Dbgrid1 Caption Name Caption Name Caption Name Caption Name Caption Name Caption Caption DataSource Tombol Operasi Cmdadd &ADD Cmdcancel &CANCEL Cmdsave &SAVE Cmdhitung &HITUNG Cmd exit E&XIT 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 Kel uar", 32 + 4, "Informasi") If psn = vbYes Then MsgBox "Makasih Yach.........", 3 2, "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.Records et.MoveNext If dbbio.Recordset.EOF Then dbbio.Recordset.MoveLast MsgBox "Sudah D iakhir Reocrd Adek...Sayang", 16, "Informasi" End If End Sub Private Sub cmdhitu ng_Click() txtbayar.Text = Val(txtharga.Text) * Val(txtjumlah.Text) If txtjumlah > 5 Then txtpot.Text = 2 / 100 * Val(txtbayar.Text) txttotal.Text = Val(txtbaya r.Text) - Val(txtpot.Text) Else txtpot.Text = 0 txttotal = Val(txtbayar.Text) Val(txtpot.Text) End If Private Sub txtjumlah_KeyPress(KeyAscii As Integer) End Sub If KeyAscii = 13 Then cmdhitung.SetFocus Private Sub cmdsave_Click() End If If tambah = True Then End Sub toko.Recordset.Update Else Private Sub txtnama_Key Press(KeyAscii As Integer) toko.Recordset.Update KeyAscii = Asc(UCase(Chr(KeyAsc ii))) End If If KeyAscii = 13 Then End Sub txtharga.SetFocus Private Sub Form_Lo ad() End If tambah = False End Sub End Sub Private Sub txtharga_KeyPress(KeyAsci i 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 Form1 Data1 Caption Name Caption Database Name Recordset Type Record Source Name Caption Database Name Recordset Type Record Source Caption Caption Caption Capt ion Caption Name DataSource DataField Text Name DataSource DataField Text Name D ataSource DataField Text Caption Caption Caption Caption Name DataSource DataFie ld Text Nilai Alga Musa Data1 Data Musik Cari Difolder Masing2 0-Table Tbl_Musik Data2 Data Fi lm Cari Difolder Masing2 1-Dynaset Tbl_Film Toko VCD Alga Musa Musik Jenis Musik Harga Jumlah Beli Text1 Data1 Sesuaikan dengan fieldnya masing2 <Kosongkan> Tex t2 Data1 Sesuaikan dengan fieldnya masing2 <Kosongkan> Text3 Data1 Sesuaikan den gan fieldnya masing2 <Kosongkan> Film Jenis Film Harga Jumlah Beli Text4 Data2 S esuaikan dengan fieldnya masing2 <Kosongkan> Data2 Label1 Frame1 Label2 Label3 Label4 Text1 Text2 Text3 Frame2 Label5 Label6 Label7 Text4 4

Text5 Text6 CommandButton1 CommandButton2 CommandButton3 CommandButton4 CommandButton5 Comma ndButton6 Frame3 Label8 Label9 Label10 Text7 Text8 Text9 CommandButton8 CommandB utton9 Name DataSource DataField Text Name DataSource DataField Text Name Caption Name Caption Name Caption Name Caption Name Caption Name Caption Caption Caption Capt ion Caption Name Text Name Text Name Text Name Caption Name Caption Text5 Data2 Sesuaikan dengan fieldnya masing2 <Kosongkan> Text6 Data2 Sesuaikan dengan fieldnya masing2 <Kosongkan> Cmdback BACK Cmdnext NEXT Cmdcarimusik CARI JENIS MUSIK Cmdback1 BACK Cmdnext1 NEXT Cmdcarifilm CARI JENIS FILM Transaksi Pe mbayaran Total Bayar Uang Bayar Uang Kembali Text7 <Kosongkan> Text8 <Kosongkan> Text9 <Kosongkan> Cmdhitung HITUNG Cmdkeluar KELUAR Listing Programnya: Dim bayar As Long Private Sub cmdback_Click() Data1.Recordset.MovePrevious If Da ta1.Recordset.BOF Then Data1.Recordset.MoveFirst MsgBox "Sudah Diawal Record Ade k", "16", "Informasi" End If End Sub Private Sub cmdcarifilm_Click() Dim soraya As String * 5 Dim lusiana As String soraya = InputBox("Ketik Kode Musik:", "Penc arian 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 S ub cmdcarimusuk_Click() Dim soraya As String * 5 soraya = InputBox("Ketik Kode M usik:", "Pencarian Biodata") alga_musa = "kd_musik '" & soraya & "'" Data1.Recor dset.Index = "kdmusik" Data1.Recordset.Seek "=", soraya If Data1.Recordset.NoMat ch Then MsgBox "Maaf Mas Kode Musik " + soraya + " tidk ada", 16, "informasi" Da ta1.Recordset.MoveFirst End If End Sub 5

Private Sub cmdhitung_Click() bayar = Val(Text2.Text) * Val(Text3.Text) + Val(Te xt5.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, "informas i" End Else If psn = vbNo Then MsgBox "Lho.....kok enggak jadi toh", 32, "Inform asi" End If End If End Sub Private Sub cmdnext_Click() Data1.Recordset.MoveNext If Data1.Recordset.EOF Then Data1.Recordset.MoveLast MsgBox "Sudah Diakhir Reocr d Adek...Sayang", 16, "Informasi" End If End Sub Private Sub cmdnext1_Click() Da ta2.Recordset.MoveNext If Data2.Recordset.EOF Then Data2.Recordset.MoveLast MsgB ox "Sudah Diakhir Reocrd Adek...Sayang", 16, "Informasi" End If End Sub Private Sub cmdback1_Click() Data2.Recordset.MovePrevious If Data2.Recordset.BOF Then Da ta2.Recordset.MoveFirst MsgBox "Sudah Diawal Record Adek", "16", "Informasi" End If End Sub Private Sub Text3_KeyPress(KeyAscii As Integer) If KeyAscii = 13 The n 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 Form1 Label1 Data1 Caption Caption Name Caption Database Name Recordset Type Rec ord Source Name Caption Database Name Recordset Type Record Source Caption DataS ource Caption DataSource Caption Caption Caption Caption Name DataSource DataFie ld Text Name DataSource DataField Text Name DataSource DataField Text Nilai Alga Musa Caf Alga Musa Data1 Data Makan Cari Difolder Masing2 0-Table Tbl_Makan D ata2 Data Minum Cari Difolder Masing2 0-Table Tbl_Minum Menu Pempek Data1 Menu M inuman Data2 Pesanan Pempek Nama Makanan Harga Jumlah Porsi Text1 Data1 Sesuaika n dengan fieldnya masing2 <Kosongkan> Text2 Data1 Sesuaikan dengan fieldnya masi ng2 <Kosongkan> Text3 Data1 Sesuaikan dengan fieldnya masing2 <Kosongkan> Data2 Dbgrid1 Dbgrid2 Frame1 Label2 Label3 Label4 Text1 Text2 Text3 7

Frame2 Label5 Label6 Label7 Text4 Text5 Text6 Frame3 Label8 Label9 Label10 Text7 Text8 Text9 CommandButton8 CommandButton9 Caption Caption Caption Caption Name DataSource DataField Text Name DataSource D ataField Text Name DataSource DataField Text Caption Caption Caption Caption Nam e Text Name Text Name Text Name Caption Name Caption Pesanan Minuman Nama Minuman Harga Jumlah Porsi Text4 Data2 Sesuaikan dengan fie ldnya masing2 <Kosongkan> Text5 Data2 Sesuaikan dengan fieldnya masing2 <Kosongk an> Text6 Data2 Sesuaikan dengan fieldnya masing2 <Kosongkan> Data Transaksi Tot al Bayar Uang Bayar Kembali Text7 <Kosongkan> Text8 <Kosongkan> Text9 <Kosongkan > Cmdhitung HITUNG 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 Ya kin Ingin Keluar", 32 + 4, "Informasi") If psn = vbYes Then MsgBox "Makasih Yach .........", 32, "informasi" End Else If psn = vbNo Then MsgBox "Lho.....kok engg ak jadi toh", 32, "Informasi" End If End If End Sub Private Sub Text3_KeyPress(K eyAscii 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 = For mat(Text8.Text - bayar, " Rp ###,###,###") & ",-" End Sub 8

Kunci Jawaban Soal Latihan Pra UAS Tipe D Objek-objek yang terkait : Objeck Form1 Label1 Data1 Properties Caption Caption Name Caption Database Name Recordset Type Record Source Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Caption Alga Mus a Motor Alga Musa Motor Motor Data Motor Cari Difolder Masing2 0-Table Tbl_Motor Honda SPR KRM LGD WIN Suzuki SMH SGN STR Yamaha FGR JPR RXK Data Transaksi Jeni s Motor Harga Motor Jumlah Beli Bayar Potongan Total Bayar Nilai Frame1 Option1 Option2 Option3 Option4 Frame2 Option5 Option6 Option7 Frame3 Opt ion8 Option9 Option10 Frame4 Label2 Label3 Label4 Label5 Label6 Label7 9

Text1 Text2 Text3 Text4 Text5 Text6 CommandButton1 CommandButton2 CommandButton3 CommandButton4 CommandButton5 Dbgri d1 Name DataSource DataField Text Name DataSource DataField Text Name DataSource Da taField Text Name DataSource DataField Text Name DataSource DataField Text Name DataSource DataField Text Name Caption Name Caption Name Caption Name Caption Na me Caption Caption DataSource txtjenis Motor Sesuaikan dengan fieldnya masing2 <Kosongkan> txtharga Motor Sesu aikan dengan fieldnya masing2 <Kosongkan> txtjumlah Motor Sesuaikan dengan field nya masing2 <Kosongkan> txtbayar Motor Sesuaikan dengan fieldnya masing2 <Kosong kan> txtpotong Motor Sesuaikan dengan fieldnya masing2 <Kosongkan> txttotal Moto r Sesuaikan dengan fieldnya masing2 <Kosongkan> Cmdtambah TAMBAH Cmdsimpan SIMPA N Cmdbatal BATAL Cmdhitung HITUNG Cmdkeluar KELUAR DATA TRANSAKSI Motor Listing Programnya: Private Sub cmdbatal_Click() motor.Recordset.CancelUpdate motor.Recordset.MoveLa st End Sub Private Sub cmdhitung_Click() txtbayar.Text = Val(txtharga.Text) * Va l(txtjumlah.Text) If txtjumlah > 5 Then txtpotong.Text = 2 / 100 * Val(txtbayar. Text) txttotal.Text = Val(txtbayar.Text) - Val(txtpotong.Text) Else txtpotong.Te xt = 0 txttotal = Val(txtbayar.Text) - Val(txtpotong.Text) End If End Sub Privat e Sub cmdkeluar_Click() psn = MsgBox("Anda Yakin Ingin Keluar", 32 + 4, "Informa si") If psn = vbYes Then MsgBox "Makasih Yach.........", 32, "informasi" End Els e If psn = vbNo Then MsgBox "Lho.....kok enggak jadi toh", 32, "Informasi" End I f End If End Sub 10

Private Sub cmdsimpan_Click() If tambah = True Then motor.Recordset.Update Else motor.Recordset.Update End If End Sub Private Sub cmdtambah_Click() tambah = Tru e motor.Recordset.AddNew txtjenis.SetFocus End Sub Private Sub Form_Load() tamba h = False Option1.Value = False Option2.Value = False Option3.Value = False Opti on4.Value = False Option5.Value = False Option6.Value = False Option7.Value = Fa lse Option9.Value = False Option10.Value = False Option11.Value = False End Sub Private Sub Option1_Click() txtjenis.Text = "Supra" txtharga.Text = 8000000 txtj umlah.SetFocus Option2.Value = False Option3.Value = False Option4.Value = False Option5.Value = False Option6.Value = False Option7.Value = False Option9.Value = False Option10.Value = False Option11.Value = False End Sub Private Sub Optio n10_Click() txtjenis.Text = "Jupiter" txtharga.Text = 10000000 txtjumlah.SetFocu s Option1.Value = False Option2.Value = False Option3.Value = False Option4.Valu e = False Option5.Value = False Option6.Value = False Option7.Value = False Opti on9.Value = False Option11.Value = False End Sub Private Sub Option11_Click() tx tjenis.Text = "RX King" txtharga.Text = 15000000 txtjumlah.SetFocus Option1.Valu e = False Option2.Value = False Option3.Value = False Option4.Value = False Opti on5.Value = False Option6.Value = False Option7.Value = False Option9.Value = Fa lse Option10.Value = False End Sub Private Sub Option2_Click() txtjenis.Text = "Karisma" txtharga.Text = 8500000 tx tjumlah.SetFocus Option1.Value = False Option3.Value = False Option4.Value = Fal se Option5.Value = False Option6.Value = False Option7.Value = False Option9.Val ue = False Option10.Value = False Option11.Value = False End Sub Private Sub Opt ion3_Click() txtjenis.Text = "Lagenda" txtharga.Text = 8560000 txtjumlah.SetFocu s Option1.Value = False Option2.Value = False Option4.Value = False Option5.Valu e = False Option6.Value = False Option7.Value = False Option9.Value = False Opti on10.Value = False Option11.Value = False End Sub Private Sub Option4_Click() tx tjenis.Text = "Honda Win" txtharga.Text = 7500000 txtjumlah.SetFocus Option1.Val ue = False Option2.Value = False Option3.Value = False Option5.Value = False Opt ion6.Value = False Option7.Value = False Option9.Value = False Option10.Value = False Option11.Value = False End Sub Private Sub Option5_Click() txtjenis.Text = "Smesh" txtharga.Text = 6500000 txtjumlah.SetFocus Option1.Value = False Option 2.Value = False Option3.Value = False Option4.Value = False Option6.Value = Fals e Option7.Value = False Option9.Value = False Option10.Value = False Option11.Va lue = False End Sub Private Sub Option6_Click() txtjenis.Text = "Sohgon" txtharg a.Text = 7800000 txtjumlah.SetFocus Option1.Value = False Option2.Value = False Option3.Value = False Option4.Value = False Option5.Value = False Option7.Value = False Option9.Value = False Option10.Value = False Option11.Value = False End Sub 11

Private Sub Option7_Click() txtjenis.Text = "Satria" txtharga.Text = 13000000 tx tjumlah.SetFocus Option1.Value = False Option2.Value = False Option3.Value = Fal se Option4.Value = False Option5.Value = False Option6.Value = False Option9.Val ue = False Option10.Value = False Option11.Value = False End Sub Private Sub Opt ion9_Click() txtjenis.Text = "Vega R" txtharga.Text = 12000000 txtjumlah.SetFocu s Option1.Value = False Option2.Value = False Option3.Value = False Option4.Valu e = False Option5.Value = False Option6.Value = False Option7.Value = False Opti on10.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 kesehat an sehingga kami mampu menyelesaikan materi Microsoft Visula Basic ini dan ucapa n terima kasih juga kami sampaikan kepada AMIK-BSI selaku lembaga yang telah mem berikan kami pasilitas sehingga semester 4 kami selesaikan dengan penuh gembira . Akhir kata kami ucapkan sampai jumpa di semester berikutnya moga kita semua dalam se lalu dalam lindungan Yang Maha Esa. Create : Agus Muhardi 12

Anda mungkin juga menyukai