DAFTAR PUSTAKA

Dwi, Didik, 101 Tip & Trik Visual Basic 6.0 Buku Kedua, 2007, PT. Elex Media Komputindo, Jakarta.
Santoso, Harip, Membuat Multiaplikasi menggunkan Visual Basic 6, 2005, PT. Elex Media Komputindo, Jakarta.
Santoso, Harip, Pemrograman Client-Server Menggunakan SQL Server 2000 dan Visual Basic 6.0, 2003, PT. Elex Media Komputindo, Jakarta
Sutarman, Membangun Aplikasi Web Dengan PHP Dan MySQL, 2003, Graha Ilmu, Yogyakarta.
Setiawan, Iwan, Langkah Mudah Membangun Jaringan Berbasis Windows 2003 Server, 2003, CV.Andi Offset, Yogyakarta.
Tim Studi Guru SPMB IPA, Panduan SPMB IPA 2006, CV. Pustaka Setia, Bandung
Tim Studi Guru SPMB IPS, Panduan SPMB IPS 2006, CV. Pustaka Setia, Bandung

LAMPIRAN
LISTING PROGRAM

LISTING PROGRAM

LISTING PROGRAM MENU CLIENT
•	Form FAbout
Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
End Sub
Private Sub Frame1_Click()
Unload Me
End Sub

•	Form Fdaftar
Dim kdjurusan As String
Private Sub cbjurusan_Change()
    If cbjurusan = "IPA" Then
    perintah = "SELECT * FROM jurusan WHERE nm_jurusan='Kemampuan IPA'"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
    End With
    ElseIf cbjurusan = "IPS" Then
    perintah = "SELECT * FROM jurusan WHERE nm_jurusan='Kemampuan IPS'"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
    End With
    Else
    perintah = "SELECT * FROM jurusan WHERE nm_jurusan='Kemampuan Umum'"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
    End With
    End If
    
    'Call nomor_peserta
End Sub
Sub nomor_peserta()
    
    Dim tahun, thn As String
    Dim nojurusan, nojur As String
        
    tahun = Date
    thn = Right(tahun, 2)
    nojurusan = Right(kdjurusan, 3)
    perintah = "SELECT * FROM peserta WHERE kd_jurusan='" & kdjurusan & "'"
    Set peserta = konekdb.Execute(perintah)
    With peserta
    If .RecordCount <> 0 Then
        .MoveLast
            nojur = !no_peserta
            nojur = Right(nojur, 3)
            nojur = Val(nojur) + 1001
            nojur = Str(nojur)
            nojur = Right(nojur, 3)
     Else
        nojur = "001"
    End If
    End With

    nomor = thn & nojurusan & nojur
  ' lblnomor.Caption = nomor
End Sub
Private Sub cbjurusan_Click()
   If cbjurusan = "IPA" Then
    perintah = "SELECT * FROM jurusan WHERE nm_jurusan='Kemampuan IPA'"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
    End With
    ElseIf cbjurusan = "IPS" Then
    perintah = "SELECT * FROM jurusan WHERE nm_jurusan='Kemampuan IPS'"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
    End With
    Else
    perintah = "SELECT * FROM jurusan WHERE nm_jurusan='Kemampuan Umum'"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
    End With
    End If
    'Call nomor_peserta
End Sub
Private Sub cmbatal_Click()
    Call bersih
  End Sub
Private Sub cmbrowse_Click()
    With CDgambar
    .Filter = " Soal Gambar |*.bmp;*.JPEG;*.jpg;*.gif;"
    .DialogTitle = "Mengambil Poto Peserta"
    .ShowOpen
    'imgsoal.Picture = LoadPicture(.FileName)
    'rbsoal.LoadFile .FileName
    txtpoto.Text = .FileName
    End With
End Sub
Private Sub cmdaftar_Click()
    If txtnama.Text = "" Then
        MsgBox "Nama masih kosong", vbInformation, "informasi"
        txtnama.SetFocus
    ElseIf txtkunci.Text = "" Then
        MsgBox "Kunci masih kosong", vbInformation, "informasi"
        txtkunci.SetFocus
    ElseIf txtalamat.Text = "" Then
        MsgBox "alamat masih kosong", vbInformation, "informasi"
        txtalamat.SetFocus
    ElseIf txtalmtsklh.Text = "" Then
        MsgBox "Alamat sekolah masih kosong", vbInformation, "informasi"
        txtalmtsklh.SetFocus
    ElseIf txtnmsklh.Text = "" Then
        MsgBox "Nama Sekolah masih kosong", vbInformation, "informasi"
        txtnmsklh.SetFocus
    ElseIf txttmptlahir.Text = "" Then
        MsgBox "Tempat Lahir masih kosong", vbInformation, "informasi"
        txttmptlahir.SetFocus
    ElseIf cbjurusan.Text = "" Then
        MsgBox "Jurusan masih kosong", vbInformation, "informasi"
        cbjurusan.SetFocus
    Else
        perintah = "SELECT * FROM peserta WHERE password='" & txtkunci & "'"
        Set peserta = konekdb.Execute(perintah)
        If peserta.RecordCount <> 0 Then
            MsgBox "Password sudah pernah ada yang memakai", vbInformation, "informasi"
            txtkunci.SetFocus
        Else
            Call nomor_peserta
            perintah = "INSERT INTO peserta(no_peserta,nama,password,kd_jurusan,tmpt_lahir,tgl_lahir,almt_asal,nm_sklh,almt_sklh,photo)" _
                        & " VALUES ('" & nomor & "','" & txtnama & "','" & txtkunci & "','" & kdjurusan & "','" & txttmptlahir & "','" & _
                        Format(tgllahir.Value, "YYYY-MM-DD") & "','" & txtalamat & "','" & txtnmsklh & "','" & txtalmtsklh & "','" & gambar & "' )"
            Set peserta = konekdb.Execute(perintah)
            MsgBox "Data " & nomor & " sudah  tersimpan"
            Fpilih.lblnomor = nomor
            Fpeserta.lblnomor = nomor
            Load Fpilih
            Fpilih.Show 1
            Unload Me
            Fdaftar.Visible = False
        End If
    End If
     
End Sub
Private Sub cmkeluar_Click()
    Unload Me
End Sub
Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    Call tampil_jurusan
End Sub
Sub bersih()
    txtnomor.Text = ""
    txtnama.Text = ""
    txtkunci.Text = ""
    txtalamat.Text = ""
    txtalmtsklh.Text = ""
    txtnmsklh.Text = ""
    txtpoto.Text = ""
    cbjurusan.Text = ""
    txttmptlahir.Text = ""
End Sub
Sub tampil_jurusan()
    cbjurusan.AddItem "IPA"
    cbjurusan.AddItem "IPS"
    cbjurusan.AddItem "IPC"
  End Sub

•	Form fguide
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
Lokasi = App.Path
  Skin1.LoadSkin Lokasi + "\skin\media.skn"
 Skin1.ApplySkin hWnd
 rtfawal.LoadFile Lokasi + "\soal\SELAMAT DATANG.rtf"
End Sub

•	Form Fhasil
Dim status, prod As String
Private Sub cmkeluar_Click()
    Call cek_data
    If hasil.RecordCount = 1 Then
        Unload Me
    Else
    Call simpan_hasil
    Unload Me
    
    End If
    'Unload Ftes
    Load Floginuser
    Floginuser.Show 1
End Sub
Sub cek_data()
    perintah = "SELECT * FROM hasil WHERE no_peserta='" & nomor & "'"
    Set hasil = konekdb.Execute(perintah)
    
End Sub
Sub simpan_hasil()
    perintah = "INSERT INTO hasil (no_peserta,skor,kd_prodi,status)" _
                & " VALUES ('" & nomor & "','" & lblgradeall & "','" & prod & "','" & status & "')"
    Set hasil = konekdb.Execute(perintah)
  End Sub
Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
 Call dbumptn.buka
 
 lblnomor.Caption = nomor
 perintah = "SELECT * FROM peserta WHERE no_peserta='" & nomor & "'"
 Set peserta = konekdb.Execute(perintah)
  lblnama.Caption = peserta!nama
 If peserta!kd_jurusan = "JR001" Then
    lblkelompok.Caption = "IPA"
 ElseIf peserta!kd_jurusan = "JR002" Then
    lblkelompok.Caption = "IPS"
 ElseIf peserta!kd_jurusan = "JR003" Then
    lblkelompok.Caption = "IPC"
 End If
  perintah = "SELECT SUM(nilai) as jumlah FROM jawaban_tes WHERE no_peserta='" & nomor & "'"
 Set jawaban = konekdb.Execute(perintah)
  lblgradeall.Caption = jawaban!jumlah
  perintah = "SELECT pilih_fak.*,prodi.*,universitas.* FROM prodi,pilih_fak,universitas " _
            & " WHERE prodi.kd_prodi=pilih_fak.kd_prodi AND universitas.kd_universitas=prodi.kd_universitas " _
            & " AND pilih_fak.no_peserta='" & nomor & "' ORDER BY pilih_fak.id_pilih"
 Set pilihfak = konekdb.Execute(perintah)
  For i = 1 To pilihfak.RecordCount
    'grade memenuhi
    If Int(lblgradeall) >= pilihfak!grade Then
        'cek prodi
        perintah = "SELECT * FROM prodi WHERE kd_prodi='" & pilihfak!kd_prodi & "'"
        Set prodi = konekdb.Execute(perintah)
        'jumlah kuota prodi yang dipilih peserta
        perintah = "SELECT * FROM hasil WHERE kd_prodi='" & pilihfak!kd_prodi & "'"
        Set hasil = konekdb.Execute(perintah)
        If hasil.RecordCount = prodi!kuota Then
            pilihfak.MoveNext
            If pilihfak.EOF Then
            lblpesan.Caption = "Grade Memenuhi, Tapi Kuota Sudah Penuh Untuk Semua Prodi Pilihan Anda"
            status = "tidak berhasil"
            prod = ""
            lbluniv.Visible = False
            lblprodi.Visible = False
            SkinLabel6.Visible = False
            SkinLabel7.Visible = False
            Exit For
            End If
         Else
     
        lbluniv.Caption = pilihfak!nm_universitas
        lblprodi.Caption = pilihfak!nm_prodi
        prod = pilihfak!kd_prodi
        status = "berhasil"
        Exit For
        End If
       End If
 Next i
 pilihfak.MoveLast
 If Int(lblgradeall) < pilihfak!grade Then
    lblpesan.Caption = "Grade Anda tidak memenuhi semua pilihan Prodi Anda"
    status = "tidak berhasil"
    prod = ""
    lbluniv.Visible = False
    lblprodi.Visible = False
    SkinLabel6.Visible = False
    SkinLabel7.Visible = False
 End If
   End Sub

Private Sub Form_Unload(Cancel As Integer)
    Unload Me
   'Unload Ftes
   ' Unload Floginuser
  End Sub

•	Form fkoreksi
Dim nosoal As Integer
Private Sub cmgo_Click()
    Dim pot As String
    pot = Left(nomor, 2)
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR003' AND bank_soal.nomor ='" & Int(txtnomor) & "' ORDER BY bank_soal.nomor "
    Set soal = konekdb.Execute(perintah)
    Call lihat_soal
End Sub

Private Sub cmselesai_Click()
    If peserta!kd_jurusan = "JR001" Then
        
        If peserta!sts = "ipa" Then
            Call ubah_hasil
        End If
    ElseIf peserta!kd_jurusan = "JR002" Then
         If peserta!sts = "ips" Then
            Call ubah_hasil
        End If
    ElseIf peserta!kd_jurusan = "JR003" Then
       If peserta!sts = "ipa" Then
            Call ubah_hasil
               
        End If
    End If
    Unload Me
End Sub
Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
 Call dbumptn.buka
 Call tampil_peserta
 Call tampil_soal
 Call kuncijawaban
 'Call koreksi
 End Sub
Sub tampil_peserta()
    perintah = "SELECT peserta.*,jurusan.* FROM jurusan,peserta " _
                & "WHERE peserta.kd_jurusan=jurusan.kd_jurusan AND peserta.no_peserta='" & nomor & "'"
    Set peserta = konekdb.Execute(perintah)
     lblnomor.Caption = nomor
    lblnama.Caption = peserta!nama
End Sub
Sub tampil_soal()
    If peserta!kd_jurusan = "JR001" Then
        lblkelompok.Caption = "IPA"
        If peserta!sts = "dasar" Then
            lblsoal.Caption = "Kemampuan Umum"
            Call soal_umum
            Call grade_umum
            Call jawaban_umum
        ElseIf peserta!sts = "ipa" Then
            lblsoal.Caption = "Kemampuan IPA"
            Call soal_ipa
            Call grade_ipa
            Call jawaban_ipa
        ElseIf peserta!sts = "hasil" Then
            MsgBox "Anda sudah pernah tes", vbInformation, "informasi"
            Load Fhasil
            Fhasil.Show 1
            Unload Me
        End If
    ElseIf peserta!kd_jurusan = "JR002" Then
        lblkelompok.Caption = "IPS"
        If peserta!sts = "dasar" Then
            lblsoal.Caption = "Kemampuan Umum"
            Call soal_umum
            Call grade_umum
            Call jawaban_umum
        ElseIf peserta!sts = "ips" Then
            lblsoal.Caption = "Kemampuan IPS"
            Call soal_ips
            Call grade_ips
            Call jawaban_ips
        ElseIf peserta!sts = "hasil" Then
            MsgBox "Anda sudah pernah tes", vbInformation, "informasi"
            Load Fhasil
            Fhasil.Show 1
            Unload Me
        End If
    ElseIf peserta!kd_jurusan = "JR003" Then
        lblkelompok.Caption = "IPC"
        If peserta!sts = "dasar" Then
            lblsoal.Caption = "Kemampuan Umum"
            Call soal_umum
            Call grade_umum
            Call jawaban_umum
        ElseIf peserta!sts = "ips" Then
            lblsoal.Caption = "Kemampuan IPS"
            Call soal_ips
            Call grade_ips
            Call jawaban_ips
        ElseIf peserta!sts = "ipa" Then
            lblsoal.Caption = "Kemampuan IPA"
            Call soal_ipa
            Call grade_ipa
            Call jawaban_ipa
        ElseIf peserta!sts = "hasil" Then
            MsgBox "Anda sudah pernah tes", vbInformation, "informasi"
            Load Fhasil
            Fhasil.Show 1
            Unload Me
        End If
    End If
    End Sub
Sub kuncijawaban()
    'tampil kunci jawaban
    lskunci.Clear
    With soal
        
        Do Until .EOF
            lskunci.AddItem !nomor & " " & !jawaban
        .MoveNext
        Loop
    End With
End Sub
Sub grade_umum()
    'grade umum
    perintah = "SELECT SUM(jawaban_tes.nilai) as grade FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR003' GROUP BY jawaban_tes.no_peserta"
    Set bantu = konekdb.Execute(perintah)
    lblgrade.Caption = Str(bantu!grade)
    'jawaban benar
    perintah1 = "SELECT COUNT(jawaban_tes.nilai) as benar FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR003' AND jawaban_tes.nilai=4 "
    Set bantu1 = konekdb.Execute(perintah1)
    lblbenar.Caption = Str(bantu1!benar)
    'jawaban salah
    perintah2 = "SELECT COUNT(jawaban_tes.nilai) as salah FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR003' AND jawaban_tes.nilai=-1 "
    Set bantu2 = konekdb.Execute(perintah2)
    lblsalah.Caption = Str(bantu2!salah)
        'jawaban kosong
    lblkosong.Caption = Str(Int(lbljumsoal) - (Int(lblsalah) + Int(lblbenar)))
 End Sub
Sub grade_ipa()
    perintah = "SELECT SUM(jawaban_tes.nilai) as grade FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR001' GROUP BY jawaban_tes.no_peserta"
    Set bantu = konekdb.Execute(perintah)
    If bantu.EOF And bantu.BOF Then
        Exit Sub
    Else
     lblgrade.Caption = Str(bantu!grade)
    End If
    'jawaban benar
    perintah1 = "SELECT COUNT(jawaban_tes.nilai) as benar FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR001' AND jawaban_tes.nilai=4 "
    Set bantu1 = konekdb.Execute(perintah1)
    lblbenar.Caption = Str(bantu1!benar)
    'jawaban salah
    perintah2 = "SELECT COUNT(jawaban_tes.nilai) as salah FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR001' AND jawaban_tes.nilai=-1 "
    Set bantu2 = konekdb.Execute(perintah2)
    lblsalah.Caption = Str(bantu2!salah)
    
    'jawaban kosong
    lblkosong.Caption = Str(Int(lbljumsoal) - (Int(lblsalah) + Int(lblbenar)))
End Sub
Sub grade_ips()
    perintah = "SELECT SUM(jawaban_tes.nilai) as grade FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR002' GROUP BY jawaban_tes.no_peserta"
    Set bantu = konekdb.Execute(perintah)
    If bantu.EOF And bantu.BOF Then
        Exit Sub
    Else
    lblgrade.Caption = Str(bantu!grade)
    End If
    'jawaban benar
    perintah1 = "SELECT COUNT(jawaban_tes.nilai) as benar FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR002' AND jawaban_tes.nilai=4 "
    Set bantu1 = konekdb.Execute(perintah1)
    lblbenar.Caption = Str(bantu1!benar)
    'jawaban salah
    perintah2 = "SELECT COUNT(jawaban_tes.nilai) as salah FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nomor & _
                "' AND soal.kd_jurusan='JR002' AND jawaban_tes.nilai=-1 "
    Set bantu2 = konekdb.Execute(perintah2)
    lblsalah.Caption = Str(bantu2!salah)
      'jawaban kosong
    lblkosong.Caption = Str(Int(lbljumsoal) - (Int(lblsalah) + Int(lblbenar)))
End Sub
Sub jawaban_umum()
    'tampil jawaban
    lstkoreksi.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR003' AND jawaban_tes.no_peserta='" & nomor & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lstkoreksi.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub
Sub jawaban_ipa()
    'tampil jawaban
    lstkoreksi.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR001' AND jawaban_tes.no_peserta='" & nomor & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lstkoreksi.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub
Sub jawaban_ips()
    'tampil jawaban
    lstkoreksi.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR002' AND jawaban_tes.no_peserta='" & nomor & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lstkoreksi.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub
Sub soal_umum()
Dim pot As String
    pot = Left(nomor, 2)
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR003' ORDER BY bank_soal.nomor "
    Set soal = konekdb.Execute(perintah)
    
    lbljumsoal.Caption = soal.RecordCount
 End Sub
Sub soal_ipa()
    Dim pot As String
    pot = Left(nomor, 2)
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR001' ORDER BY bank_soal.nomor "
    Set soal = konekdb.Execute(perintah)
    lbljumsoal.Caption = soal.RecordCount
End Sub
Sub soal_ips()
    Dim pot As String
    pot = Left(nomor, 2)
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR002' ORDER BY bank_soal.nomor "
    Set soal = konekdb.Execute(perintah)
    lbljumsoal.Caption = soal.RecordCount
End Sub
Sub lihat_soal()
       
    rbsoal.LoadFile App.Path & "\soal\" & soal!nm_jurusan & "\" & soal!nm_bidang & "\" & soal!soal
    'If soal!gambar = "" Then
     '   gambar.Visible = False
    'Else
     '   gambar.Picture = LoadPicture(App.Path & "\soal\" & soal!nm_jurusan & "\" & soal!nm_bidang & "\" & soal!gambar)
    'End If
 End Sub
Sub ubah_hasil()
    perintah = "UPDATE peserta SET sts='hasil' WHERE no_peserta='" & nomor & "'"
    Set peserta = konekdb.Execute(perintah)
 End Sub

•	Form Floginuser
Private Sub cmbatal_Click()
    Call bersih
End Sub

Private Sub cmdaftar_Click()
    Load Fdaftar
    Fdaftar.Show 1
    Unload Me
End Sub
Private Sub cmkeluar_Click()
    Unload Me
    Unload Ftes
End Sub
Private Sub cmlogin_Click()
On Error Resume Next
    If txtnomor.Text = "" Then
        MsgBox "Nomor peserta masih kosong", vbInformation, "Informasi"
        txtnomor.SetFocus
    ElseIf txtkunci.Text = "" Then
        MsgBox "Password masih kosong", vbInformation, "Informasi"
    Else
        perintah = "SELECT * FROM peserta WHERE no_peserta='" & txtnomor & "' AND password='" & txtkunci & "'"
        Set peserta = konekdb.Execute(perintah)
        If peserta.RecordCount = 0 Then
            MsgBox "Nomor peserta dan password salah", vbInformation, "informasi"
            bersih
            txtnomor.SetFocus
        Else
            nomor = txtnomor.Text
            Unload Me
            'Load Ftes
            Ftes.Show 1
            'Load fkoreksi
            'fkoreksi.Show 1
            'Floginuser.Visible = False
         End If
    End If
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    
End Sub

Sub bersih()
    txtkunci.Text = ""
    txtnomor.Text = ""
    txtnomor.SetFocus
   End Sub

•	Form FMenuUtama
Dim Lokasi As String
Private Sub cmabout_Click()
FAbout.Show 1
End Sub
Private Sub cmbidang_Click()
flsprodi.Show 1
End Sub
Private Sub cmdaftar_Click()
 Load Fdaftar
 Fdaftar.Show 1
End Sub
Private Sub cmexit_Click()
Unload Me
End Sub
Private Sub cmloginA_Click()
flogin.Show 1
End Sub
Private Sub cmloginP_Click()
Floginuser.Show 1
End Sub
Private Sub cmloginuser_Click()
Load Floginuser
    Floginuser.Show 1
End Sub
Private Sub cmsoal_Click()
FAbout.Show 1
End Sub
Private Sub Command1_Click()
fguide.Show 1
End Sub
Private Sub Form_Load()
 Lokasi = App.Path
  Skin1.LoadSkin Lokasi + "\skin\media.skn"
 Skin1.ApplySkin hWnd
 'rtfawal.LoadFile Lokasi + "\soal\SELAMAT DATANG.rtf"
    Call dbumptn.buka
    adminkeluar
End Sub
Private Sub mnbank_Click()
    Load Fbank
    Fbank.Show 1
  End Sub
Private Sub mnbidang_Click()
    Load Fbidang
    Fbidang.Show 1
End Sub
Private Sub mndaftar_Click()
    Load Fdaftar
    Fdaftar.Show 1
End Sub
Private Sub mnjurusan_Click()
    Load Fjurusan
    Fjurusan.Show 1
End Sub
Private Sub mnkelompok_Click()
    Load Fkelompok
    Fkelompok.Show 1
End Sub
Private Sub mnkeluar_Click()
    End
End Sub
Private Sub mnlogin_Click()
    Load flogin
    flogin.Show
 End Sub
Sub adminmasuk()
    mnlogin.Enabled = False
    mnlogout.Enabled = True
    mnmasukan.Visible = True
    mntes.Visible = False
  
End Sub

Sub adminkeluar()
    mnlogin.Enabled = True
    mnlogout.Enabled = False
    mnmasukan.Visible = False
    mntes.Visible = True
End Sub
Private Sub mnloginpeserta_Click()
    Load Floginuser
    Floginuser.Show 1
End Sub
Private Sub mnlogout_Click()
    adminkeluar
End Sub
Private Sub mnprodi_Click()
    Load Fprodi
    Fprodi.Show 1
End Sub
Private Sub mnsoal_Click()
    Load Fsoal
    Fsoal.Show 1
End Sub
Private Sub mntipe_Click()
    Load Ftipe
    Ftipe.Show 1
End Sub
Private Sub mnuniversitas_Click()
    Load Funiversitas
    Funiversitas.Show 1
End Sub

•	Form Fpeserta
Private Sub cmkeluar_Click()
    Unload Me
    Unload Fdaftar
End Sub
Private Sub cmlogin_Click()
    'Unload Fdaftar
    Unload Fpilih
    Unload Me
    'Load Floginuser
    Floginuser.Show 1
 End Sub
Private Sub Form_Activate()
    Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    perintah = "SELECT peserta.*,jurusan.* FROM peserta,jurusan " & _
                " WHERE peserta.kd_jurusan=jurusan.kd_jurusan AND peserta.no_peserta='" & Fpeserta.lblnomor & "'"
    Set peserta = konekdb.Execute(perintah)
     With peserta
        If .EOF And .BOF Then
            Exit Sub
        Else
        'lblnomor.Caption = Str(!no_peserta)
        lblnama.Caption = !nama
        lblpassword.Caption = !Password
        lbljurusan.Caption = !nm_jurusan
        lbltempat.Caption = !tmpt_lahir
        lbltgllahir.Caption = !tgl_lahir
        lblalamat.Caption = !almt_asal
        lblsekolah.Caption = !nm_sklh
        lblalmtsklh.Caption = !almt_sklh
        lblgambar.Caption = !photo
        End If
    End With
    Call tampil_prodi
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\green.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    perintah = "SELECT peserta.*,jurusan.* FROM peserta,jurusan " & _
                " WHERE peserta.kd_jurusan=jurusan.kd_jurusan AND peserta.no_peserta='" & Fpeserta.lblnomor & "'"
    Set peserta = konekdb.Execute(perintah)
     
    With peserta
        If .EOF And .BOF Then
            Exit Sub
        Else
        'lblnomor.Caption = Str(!no_peserta)
        lblnama.Caption = !nama
        lblpassword.Caption = !Password
        lbljurusan.Caption = !nm_jurusan
        lbltempat.Caption = !tmpt_lahir
        lbltgllahir.Caption = !tgl_lahir
        lblalamat.Caption = !almt_asal
        lblsekolah.Caption = !nm_sklh
        lblalmtsklh.Caption = !almt_sklh
        lblgambar.Caption = !photo
        End If
    End With
    Call tampil_prodi
    
End Sub

Sub tampil_prodi()
    lsprodi.Clear
    perintah = "SELECT prodi.*,pilih_fak.*,universitas.* FROM universitas,prodi,pilih_fak " _
    & " WHERE universitas.kd_universitas=prodi.kd_universitas AND pilih_fak.kd_prodi=prodi.kd_prodi AND pilih_fak.no_peserta = '" & Fpeserta.lblnomor & "'"
    Set prodi = konekdb.Execute(perintah)
    
    Do Until prodi.EOF
        lsprodi.AddItem prodi!kd_prodi & " " & prodi!nm_prodi & " " & prodi!nm_universitas
    prodi.MoveNext
    Loop
End Sub

•	Form Fpilih
im kduniversitas, kdprodi As String

Private Sub cbuniversitas_Click()
   perintah = "SELECT * FROM universitas WHERE nm_universitas='" & cbuniversitas & "'"
   Set universitas = konekdb.Execute(perintah)
   With universitas
        If .EOF And .BOF Then
            Exit Sub
        Else
            kduniversitas = !kd_universitas
        End If
   End With
   Call tampil_peserta
   Call tampil_prodi
End Sub

Private Sub cmhapus_Click()
    kdprodi = Mid(lspilih.Text, 1, 5)
    perintah = "SELECT * FROM pilih_fak WHERE no_peserta ='" & lblnomor & "' AND kd_prodi='" & kdprodi & "'"
    Set pilihfak = konekdb.Execute(perintah)
    If MsgBox("Anda yakin akan menghapus " & kdprodi & "?", vbYesNo, "Informasi") = vbYes Then
        perintah = "DELETE FROM pilih_fak WHERE id_pilih='" & pilihfak!id_pilih & "'"
        Set pilihfak = konekdb.Execute(perintah)
        Call Form_Load
    End If
End Sub

Private Sub cmkeluar_Click()
    Select Case peserta!kd_jurusan
        Case "JR001"
            If lspilih.ListCount > 2 Then
                MsgBox "Maaf anda memilih Prodi lebih dari 2", vbInformation, "Informasi"
                Exit Sub
            Else
                Unload Me
                Load Fpeserta
                Fpeserta.Show 1
            End If
        Case "JR002"
            If lspilih.ListCount > 2 Then
                MsgBox "Maaf anda memilih Prodi lebih dari 2", vbInformation, "Informasi"
                Exit Sub
            Else
                Unload Me
                Load Fpeserta
                Fpeserta.Show 1
            End If
        Case "JR003"
            perintah = "SELECT pilih_fak.*,prodi.* FROM prodi,pilih_fak WHERE pilih_fak.kd_prodi=prodi.kd_prodi AND prodi.kd_jurusan='JR001' AND pilih_fak.no_peserta='" & lblnomor & "'"
            Set prodi = konekdb.Execute(perintah)
                
            perintah1 = "SELECT pilih_fak.*,prodi.* FROM prodi,pilih_fak WHERE pilih_fak.kd_prodi=prodi.kd_prodi AND prodi.kd_jurusan='JR002' AND pilih_fak.no_peserta='" & lblnomor & "'"
            Set pilihfak = konekdb.Execute(perintah1)
                    
            If lspilih.ListCount > 3 Then
                MsgBox "Maaf anda memilih Prodi lebih dari 3", vbInformation, "Informasi"
                Exit Sub
               ElseIf prodi.RecordCount >= 3 Then
                    MsgBox "Maaf Anda Memilih Prodi Jurusan IPA lebih dari 2", vbInformation, "informasi"
                    Exit Sub
            ElseIf pilihfak.RecordCount >= 3 Then
                        MsgBox "Maaf Anda Memilih Prodi Jurusan IPS lebih dari 2", vbInformation, "informasi"
                        Exit Sub
            Else
                        Unload Me
                        Load Fpeserta
                        Fpeserta.Show 1
        End If
 End Select
    
End Sub

Private Sub cmsimpan_Click()
    For i = 0 To lsprodi.ListCount - 1
        kdprodi = Mid(lsprodi.List(i), 1, 5)
        If lsprodi.Selected(i) = True Then
        'cek prodi
        perintah = "SELECT * FROM pilih_fak WHERE no_peserta ='" & lblnomor & "' AND kd_prodi='" & kdprodi & "'"
        Set prodi = konekdb.Execute(perintah)
        If prodi.RecordCount = 1 Then
            MsgBox "Prodi ada yang sama", vbInformation, "Informasi"
        Else
        
        perintah = "INSERT INTO pilih_fak(no_peserta,kd_prodi) VALUES ('" & lblnomor & "','" & kdprodi & "')"
        Set pilihfak = konekdb.Execute(perintah)
        
        End If
          End If
    Next i
    Call Form_Load
 End Sub
Private Sub Form_Load()
    Skin1.LoadSkin App.Path + "\skin\media.skn"
    Skin1.ApplySkin hWnd

    Call dbumptn.buka
    Call tampil_peserta
    Call tampil_pilih
    Call tampil_universitas
    
End Sub
Sub tampil_universitas()
    cbuniversitas.Clear
    perintah = "SELECT * FROM universitas ORDER BY kd_universitas"
    Set universitas = konekdb.Execute(perintah)
    Do Until universitas.EOF
        cbuniversitas.AddItem universitas!nm_universitas
      universitas.MoveNext
    Loop
End Sub
sub tampil_prodi()
    lsprodi.Clear
    If lblkelompok.Caption = "IPC" Then
    perintah = "SELECT * FROM prodi WHERE kd_universitas='" & kduniversitas & "'"
    Set prodi = konekdb.Execute(perintah)
    If prodi.BOF And prodi.EOF Then
        Exit Sub
    Else
    Do Until prodi.EOF
        lsprodi.AddItem prodi!kd_prodi & "-" & prodi!nm_prodi & "->" & prodi!grade
        
    prodi.MoveNext
    Loop
    End If
    Else
    perintah = "SELECT * FROM prodi WHERE kd_universitas='" & kduniversitas & "' AND kd_jurusan='" & peserta!kd_jurusan & "'"
    Set prodi = konekdb.Execute(perintah)
    If prodi.BOF And prodi.EOF Then
        Exit Sub
    Else
    Do Until prodi.EOF
        lsprodi.AddItem prodi!kd_prodi & "-" & prodi!nm_prodi & "->" & prodi!grade
        
    prodi.MoveNext
    Loop
    End If
    
    End If
End Sub

Sub tampil_peserta()
    lblnomor.Caption = nomor
    perintah = "SELECT * FROM peserta WHERE no_peserta ='" & lblnomor & "'"
    Set peserta = konekdb.Execute(perintah)
    
    lblnama.Caption = peserta!nama
    
    If peserta!kd_jurusan = "JR001" Then
        lblkelompok.Caption = "IPA"
    ElseIf peserta!kd_jurusan = "JR002" Then
        lblkelompok.Caption = "IPS"
    ElseIf peserta!kd_jurusan = "JR003" Then
        lblkelompok.Caption = "IPC"
    End If
End Sub
Sub tampil_pilih()
    lspilih.Clear
    perintah = "SELECT prodi.*,pilih_fak.* FROM prodi,pilih_fak " _
                & "WHERE prodi.kd_prodi=pilih_fak.kd_prodi AND no_peserta='" & lblnomor & "'"
    Set pilihfak = konekdb.Execute(perintah)
    With pilihfak
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            lspilih.AddItem !kd_prodi & "-" & !nm_prodi & "->" & !grade
            .MoveNext
            Loop
        End If
    End With
End Sub

•	Form FSplash
Option Explicit
Private m_bDone As Boolean
Private Const MINIMUM_DISPLAY_TIME As Single = 3#
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyEscape Then
    ReadyToClose = True
    tmrDelay.Enabled = False
    Me.Hide
  End If
End Sub

Private Sub Form_Load()
   Skin1.LoadSkin App.Path + "\skin\media.skn"
   Skin1.ApplySkin hWnd
  On Error Resume Next
    ReadyToClose = False
  tmrDelay.Interval = MINIMUM_DISPLAY_TIME * 150
  tmrDelay.Enabled = True
  
  Me.KeyPreview = True
  Me.MousePointer = vbHourglass
  Me.Show
  
  DoEvents
End Sub

Private Sub tmrDelay_Timer()
  On Error Resume Next
    tmrDelay.Enabled = False
  ReadyToClose = True
End Sub

Public Property Get ReadyToClose() As Boolean
  ReadyToClose = m_bDone
End Property

Private Property Let ReadyToClose(ByVal Flag As Boolean)
  m_bDone = Flag
End Property

•	Form Ftes
Dim nosoal As Integer
Dim waktu As Long

Private Sub cmback_Click()
    If nosoal <= 1 Then
        cmback.Enabled = False
    Else
        cmback.Enabled = True
        cmnext.Enabled = True
    nosoal = nosoal - 1
    Call tampil_soal
    'soal.MovePrevious
    'If soal.BOF Then
     '   soal.MoveFirst
    'End If
      Call lihat_soal
    End If
End Sub
Sub opkosong()
    opA.Value = False
    opB.Value = False
    opC.Value = False
    opD.Value = False
    opE.Value = False
    
End Sub
Private Sub cmbatal_Click()
    Call opkosong
    perintah = "DELETE FROM jawaban_tes WHERE kd_bsoal='" & soal!kd_bsoal & "' AND no_peserta='" & nomor & "'"
    Set bantu = konekdb.Execute(perintah)
       perintah = "UPDATE soal SET status='kosong' WHERE kd_soal='" & soal!kd_soal & "'"
    Set bantu = konekdb.Execute(perintah)
 End Sub
Private Sub cmgo_Click()
    If txtnomor <= 0 Then
        MsgBox "Nomor Kurang dari dari pada 1", vbInformation, "Informasi"
        txtnomor.Text = ""
        txtnomor.SetFocus
    ElseIf Int(txtnomor) > 75 Then
        MsgBox "Nomor Lebih dari 75", vbInformation, "informasi"
        txtnomor.Text = ""
        txtnomor.SetFocus
    Else
    nosoal = Int(txtnomor)
    
    Call tampil_soal
    Call lihat_soal
    End If
End Sub
Private Sub cmjawab_Click()
Dim jwb As String
Dim nilai As Integer
    
    If opA.Value = True Then
        jwb = "A"
    ElseIf opB.Value = True Then
        jwb = "B"
    ElseIf opC.Value = True Then
        jwb = "C"
    ElseIf opD.Value = True Then
        jwb = "D"
    ElseIf opE.Value = True Then
        jwb = "E"
    End If
        If soal!jawaban = jwb Then
        nilai = 4
    ElseIf soal!jawaban <> jwb Then
        nilai = -1
    Else
        nilai = 0
    End If
       'ubah status soal
    perintah = "UPDATE soal SET status='isi' WHERE kd_soal='" & soal!kd_soal & "'"
    Set bantu = konekdb.Execute(perintah)
    
    perintah = "SELECT * FROM jawaban_tes WHERE  kd_bsoal='" & soal!kd_bsoal & "' AND no_peserta='" & nomor & "'"
    Set bantu = konekdb.Execute(perintah)
    If bantu.RecordCount = 1 Then
        perintah = "UPDATE jawaban_tes SET jawab='" & jwb & "' WHERE kd_bsoal='" & soal!kd_bsoal & "' AND no_peserta='" & nomor & "'"
        Set jawaban = konekdb.Execute(perintah)
        
    Else
        'masukan ke jawaban tes
        perintah = "INSERT INTO jawaban_tes (kd_bsoal,jawab,no_peserta,nilai) " _
                   & " VALUES ('" & soal!kd_bsoal & "','" & jwb & "','" & nomor & "','" & nilai & "')"
        Set jawaban = konekdb.Execute(perintah)
    End If
       ' nosoal = nosoal
    Call tampil_soal
    'Call lihat_soal
       End Sub
Sub jawaban_umum()
    'tampil jawaban
    lstjawab.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR003' AND jawaban_tes.no_peserta='" & nomor & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lstjawab.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub
Sub jawaban_ipa()
    'tampil jawaban
    lstjawab.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR001' AND jawaban_tes.no_peserta='" & nomor & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lstjawab.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub
Sub jawaban_ips()
    'tampil jawaban
    lstjawab.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR002' AND jawaban_tes.no_peserta='" & nomor & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lstjawab.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub
Private Sub cmnext_Click()
    If nosoal = 75 Then
        cmnext.Enabled = False
    Else
        cmnext.Enabled = True
        cmback.Enabled = True
    nosoal = nosoal + 1
    Call tampil_soal
    
    'If soal.EOF Then
     '   soal.MoveLast
   ' End If
    
    Call lihat_soal
    End If
End Sub

Private Sub cmselesai_Click()
If peserta!kd_jurusan = "JR001" Then
        
        If peserta!sts = "daftar" Then
            Call ubah_dasar
        ElseIf peserta!sts = "dasar" Then
            Call ubah_ipa
        End If
    ElseIf peserta!kd_jurusan = "JR002" Then
      
        If peserta!sts = "daftar" Then
            Call ubah_dasar
        ElseIf peserta!sts = "dasar" Then
            Call ubah_ips
        
        End If
    ElseIf peserta!kd_jurusan = "JR003" Then
        
        If peserta!sts = "daftar" Then
            Call ubah_dasar
        ElseIf peserta!sts = "dasar" Then
            Call ubah_ips
        ElseIf peserta!sts = "ips" Then
            Call ubah_ipa
        
        End If
    End If
    Unload Me
    Load fkoreksi
    fkoreksi.Show 1
End Sub

Private Sub Form_Load()

nosoal = 1

Skin1.LoadSkin App.Path + "\skin\media.skn"
Skin1.ApplySkin hWnd
 
 Call dbumptn.buka
 'status soal kosong
 perintah = "UPDATE soal SET status='kosong'"
 Set bantu = konekdb.Execute(perintah)
 
 Call tampil_peserta
 Call tampil_soal
 'Call lihat_soal
 waktu = 150
 
End Sub

Sub tampil_soal()
    If peserta!kd_jurusan = "JR001" Then
        lblkelompok.Caption = "IPA"
        If peserta!sts = "daftar" Then
            Call soal_umum
            Call jawaban_umum
            Call lihat_soal
        ElseIf peserta!sts = "dasar" Then
            Call soal_ipa
            Call jawaban_ipa
            Call lihat_soal
        ElseIf peserta!sts = "hasil" Then
          MsgBox "Anda sudah pernah tes", vbInformation, "informasi"
            Unload Me
           ' Load Fhasil
            Fhasil.Show 1
        End If
    ElseIf peserta!kd_jurusan = "JR002" Then
        lblkelompok.Caption = "IPS"
        If peserta!sts = "daftar" Then
            Call soal_umum
            Call jawaban_umum
            Call lihat_soal
        ElseIf peserta!sts = "dasar" Then
            Call soal_ips
            Call jawaban_ips
            Call lihat_soal
        ElseIf peserta!sts = "hasil" Then
            MsgBox "Anda sudah pernah tes", vbInformation, "informasi"
            Unload Me
            'Load Fhasil
            Fhasil.Show 1
            
        End If
    ElseIf peserta!kd_jurusan = "JR003" Then
        lblkelompok.Caption = "IPC"
        If peserta!sts = "daftar" Then
            Call soal_umum
            Call jawaban_umum
            Call lihat_soal
        ElseIf peserta!sts = "dasar" Then
            Call soal_ips
            Call jawaban_ips
            Call lihat_soal
        ElseIf peserta!sts = "ips" Then
            Call soal_ipa
            Call jawaban_ipa
            Call lihat_soal
        ElseIf peserta!sts = "hasil" Then
            MsgBox "Anda sudah pernah tes", vbInformation, "informasi"
            Unload Me
            'Load Fhasil
            Fhasil.Show 1
        End If
    End If
End Sub

Sub tampil_peserta()
    perintah = "SELECT peserta.*,jurusan.* FROM jurusan,peserta " _
                & "WHERE peserta.kd_jurusan=jurusan.kd_jurusan AND peserta.no_peserta='" & nomor & "'"
    Set peserta = konekdb.Execute(perintah)
    
    lblnomor.Caption = nomor
    lblnama.Caption = peserta!nama
    
End Sub

Sub lihat_soal()
   ' On Error Resume Next
    
   ' rbsoal.LoadFile App.Path & "\soal\" & soal!nm_jurusan & "\" & soal!nm_bidang & "\" & soal!soal
    rbsoal.LoadFile App.Path & "\soal\" & soal!nm_jurusan & "\" & soal!nm_bidang & "\" & soal!soal
    lblsub.Caption = soal!nm_bidang
    If soal!gambar = "" Then
        gambar.Visible = False
    Else
        gambar.Visible = True
        'gambar.Picture = LoadPicture(App.Path & "\soal\" & soal!nm_jurusan & "\" & soal!nm_bidang & "\" & soal!gambar)
        gambar.Picture = LoadPicture(App.Path & "\soal\" & soal!nm_jurusan & "\" & soal!nm_bidang & "\" & soal!gambar)
    End If
    lblnosoal.Caption = soal!nomor
    
    perintah = "SELECT * FROM soal,bank_soal WHERE soal.kd_soal=bank_soal.kd_soal AND bank_soal.kd_bsoal='" & soal!kd_bsoal & "'"
    Set bantu = konekdb.Execute(perintah)
    
    If bantu!status = "isi" Then
        lblstatus.Caption = "Sudah Dijawab"
        perintah = "SELECT * FROM jawaban_tes WHERE kd_bsoal='" & bantu!kd_bsoal & "' AND no_peserta='" & nomor & "'"
        
        Set jawaban = konekdb.Execute(perintah)
    
        With jawaban
        If .EOF And .BOF Then
            Exit Sub
        Else
            If !jawab = "A" Then
                opA.Value = True
            ElseIf !jawab = "B" Then
                opB.Value = True
            ElseIf !jawab = "C" Then
                opC.Value = True
            ElseIf !jawab = "D" Then
                opD.Value = True
            ElseIf !jawab = "E" Then
                opE.Value = True
            End If
        End If
        End With
    Else
        lblstatus.Caption = "Belum Terjawab"
        Call opkosong
    End If
    
    lblterjawab.Caption = lstjawab.ListCount
    txtketerangan.Text = soal!keterangan
    
End Sub
Sub soal_umum()
Dim pot As String
    pot = Left(nomor, 2)
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR003' ORDER BY bank_soal.nomor "
    Set soal = konekdb.Execute(perintah)
    
    lbldari.Caption = soal.RecordCount
    lblsoal.Caption = "KEMAMPUAN UMUM"
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR003' AND bank_soal.nomor='" & nosoal & "'"
    Set soal = konekdb.Execute(perintah)
End Sub
Sub soal_ipa()
    Dim pot As String
    pot = Left(nomor, 2)
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR001' ORDER BY bank_soal.nomor"
    Set soal = konekdb.Execute(perintah)
    lbldari.Caption = soal.RecordCount
    lblsoal.Caption = "KEMAMPUAN IPA"
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR001' AND bank_soal.nomor='" & nosoal & "'"
    Set soal = konekdb.Execute(perintah)
End Sub
Sub soal_ips()
    Dim pot As String
    pot = Left(nomor, 2)
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR002' ORDER BY bank_soal.nomor"
    Set soal = konekdb.Execute(perintah)
    lbldari.Caption = soal.RecordCount
    lblsoal.Caption = "KEMAMPUAN IPS"
    perintah = "SELECT bank_soal.*,soal.*,bid_studi.*,jurusan.*,tipe_soal.* FROM jurusan,bid_studi,soal,bank_soal,tipe_soal WHERE tahun='20" & pot & "'" _
                & " AND tipe_soal.kd_tipe=soal.kd_tipe AND soal.kd_soal=bank_soal.kd_soal AND bid_studi.kd_bidang = soal.kd_bidang " _
                & " AND soal.kd_jurusan=jurusan.kd_jurusan AND soal.kd_jurusan = 'JR002' AND bank_soal.nomor='" & nosoal & "'"
    Set soal = konekdb.Execute(perintah)
End Sub
Sub ubah_dasar()
    perintah = "UPDATE peserta SET sts='dasar' WHERE no_peserta='" & nomor & "'"
    Set peserta = konekdb.Execute(perintah)
    
End Sub
Sub ubah_ips()
    perintah = "UPDATE peserta SET sts='ips' WHERE no_peserta='" & nomor & "'"
    Set peserta = konekdb.Execute(perintah)
    
End Sub
Sub ubah_ipa()
    perintah = "UPDATE peserta SET sts='ipa' WHERE no_peserta='" & nomor & "'"
    Set peserta = konekdb.Execute(perintah)
    
End Sub
Sub ubah_hasil()
    perintah = "UPDATE peserta SET sts='hasil' WHERE no_peserta='" & nomor & "'"
    Set peserta = konekdb.Execute(perintah)
    
End Sub
Private Sub Form_Unload(Cancel As Integer)
    Unload Me
    
    Unload Floginuser
End Sub

Private Sub Timer1_Timer()
    waktu = waktu - 1
    If waktu = 1 Then
        MsgBox "Waktu anda tersisa 15 Menit lagi" & vbCrLf & "Setelah Waktu Habis Otomatis Tes akan dihentikan", vbInformation, "Informasi"
    ElseIf waktu = 0 Then
        Call cmselesai_Click
    Else
        lbwaktu.Caption = waktu
        
    End If
End Sub

•	Module dbumptn
Option Explicit
Public konekdb  As ADODB.Connection
Public universitas As ADODB.Recordset
Public prodi As ADODB.Recordset
Public pilihfak As ADODB.Recordset
Public hasil As ADODB.Recordset
Public peserta As ADODB.Recordset
Public jurusan As ADODB.Recordset
Public soal As ADODB.Recordset
Public bidang As ADODB.Recordset
Public kelompok As ADODB.Recordset
Public jawaban As ADODB.Recordset
Public tipe As ADODB.Recordset
Public bank As ADODB.Recordset
Public admin As ADODB.Recordset
Public bantu, bantu1, bantu2 As ADODB.Recordset

Public perintah, perintah1, perintah2, kode As String
Public nomor As String

Sub buka()
Set konekdb = New ADODB.Connection
'koneksi mysql
konekdb.CursorLocation = adUseClient

konekdb.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" & _
                        "SERVER=localhost;" & _
                        "DATABASE=umptn;" & _
                        "UID=root;" & _
                        "PASSWORD=;" & _
                        "PORT=3306;OPTION=;STMT=;"
'koneksi acces

konekdb.Open
Set universitas = New ADODB.Recordset
Set prodi = New ADODB.Recordset
Set pilihfak = New ADODB.Recordset
Set hasil = New ADODB.Recordset
Set peserta = New ADODB.Recordset
Set kelompok = New ADODB.Recordset
Set bidang = New ADODB.Recordset
Set jurusan = New ADODB.Recordset
Set soal = New ADODB.Recordset
Set bantu = New ADODB.Recordset
Set bantu1 = New ADODB.Recordset
Set bantu2 = New ADODB.Recordset
Set jawaban = New ADODB.Recordset
Set tipe = New ADODB.Recordset
Set bank = New ADODB.Recordset
Set admin = New ADODB.Recordset
End Sub
Private Sub Main()
   FSplash.Show
  Load FMenuUtama
   Do
    DoEvents
  Loop Until FSplash.ReadyToClose
   FMenuUtama.Show
  Unload FSplash
  Set FSplash = Nothing
End Sub

LISTING PROGRAM MENU ADMIN

•	Form Fbank
    Dim Lokasi As String
    Dim i As Integer
    Dim cari As String

Private Sub cbtahun_Click()

    Call hapus_list
    For i = 0 To lssoal.ListCount - 1
        lssoal.Selected(i) = False
    Next i
    
    'kode = Mid(cbtahun, 1, 4)
    perintah = "select * from bank_soal where tahun='" & cbtahun & "'"
    Set bank = konekdb.Execute(perintah, , adCmdText)
    With bank
        If .EOF And .BOF Then
            MsgBox "data bank soal masih kosong", vbInformation, "informasi"
            Exit Sub
        Else
            Do Until .EOF
            cari = !kd_soal
            For i = 0 To lssoal.ListCount - 1
                If Mid(lssoal.List(i), 1, 4) = cari Then
                    lssoal.Selected(i) = True
                    Call tampil_bhsind
                    Call tampil_bhsing
                    Call tampil_Biologi
                    Call tampil_ekonomi
                    Call tampil_fisika
                    Call tampil_geografi
                    Call tampil_IPAT
                    Call tampil_IPST
                    Call tampil_kimia
                    Call tampil_matdas
                    Call tampil_matIPA
                    Call tampil_sejarah
                End If
            Next i
            .MoveNext
            Loop
            Call hitung_list
        End If
    End With
    
End Sub

Private Sub cmkeluar_Click()
    Unload Me
End Sub

Private Sub cmsimpan_Click()

    'kode = Mid(cbtahun.Text, 1, 4)
    perintah = "DELETE from bank_soal where tahun='" & cbtahun & "'"
    Set bank = konekdb.Execute(perintah, , adCmdText)

    For i = 0 To lssoal.ListCount - 1
        cari = Mid(lssoal.List(i), 1, 4)
        If lssoal.Selected(i) = True Then
            Call tampil_bank
            Call tambah
            
            perintah = "INSERT INTO bank_soal (kd_bsoal,kd_soal,tahun) VALUES ('" & _
            kode & "','" & cari & "','" & cbtahun & "')"
            konekdb.Execute perintah, , adCmdText
            
        End If
    Next i
    
    Call cbtahun_Click
'   Load Fanimasi
End Sub

Private Sub cmubah_Click()
Dim kode As String
    kode = Mid(lssoal.Text, 1, 4)
    perintah = "SELECT * FROM bank_soal WHERE kd_soal='" & kode & "' AND tahun='" & cbtahun & "'"
    Set soal = konekdb.Execute(perintah)
    If soal.EOF And soal.BOF Then
        MsgBox "soal tidak masuk tahun ini", vbInformation, "Informasi"
    Else
    perintah = "UPDATE bank_soal SET nomor ='" & txtnomor & "' WHERE kd_bsoal='" & soal!kd_bsoal & "'"
    Set bank = konekdb.Execute(perintah)
    End If
End Sub

Private Sub Form_Load()
   Lokasi = App.Path
   Skin1.LoadSkin Lokasi + "\skin\media.skn"
   Skin1.ApplySkin hWnd

    Call dbumptn.buka
    Call tampil_bank
    lssoal.Clear
    perintah = "SELECT * FROM soal ORDER BY kd_bidang"
    Set soal = konekdb.Execute(perintah)
    With soal
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            lssoal.AddItem !kd_soal & " - " & !soal
            .MoveNext
            Loop
        End If
    End With
End Sub
Sub tampil_bank()
    perintah = "SELECT * FROM bank_soal ORDER BY kd_bsoal"
    Set bank = konekdb.Execute(perintah)

End Sub
Sub tambah()

Dim nomor As String
     
    With bank
        If .RecordCount < 1 Then
            kode = "B001"
        Else
            .MoveLast
            nomor = !kd_bsoal
            nomor = Right(nomor, 3)
            nomor = Val(nomor) + 1001
            nomor = Str(nomor)
            nomor = Right(nomor, 3)
            
            kode = "B" + nomor
                    
        End If
    End With
End Sub

Private Sub lssoal_Click()

    cari = Mid(lssoal.Text, 1, 4)
    perintah = "SELECT * FROM soal WHERE kd_soal='" & cari & "'"
    Set soal = konekdb.Execute(perintah)
    
    perintah = "SELECT * FROM jurusan WHERE kd_jurusan='" & soal!kd_jurusan & "'"
    Set jurusan = konekdb.Execute(perintah)
    
    perintah = "SELECT * FROM bid_studi WHERE kd_bidang='" & soal!kd_bidang & "'"
    Set bidang = konekdb.Execute(perintah)
    
    rbsoal.LoadFile App.Path & "\soal\" & jurusan!nm_jurusan & "\" & bidang!nm_bidang & "\" & soal!soal
    
    lstahun.Clear
    perintah = "SELECT * FROM bank_soal WHERE kd_soal='" & cari & "'"
    Set bank = konekdb.Execute(perintah)
    With bank
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            lstahun.AddItem !tahun
            .MoveNext
            Loop
        End If
        
    End With
    
    perintah = "SELECT * FROM bank_soal WHERE kd_soal='" & cari & "' AND tahun='" & cbtahun & "'"
    Set bantu = konekdb.Execute(perintah)
    If bantu.EOF And bantu.BOF Then
        Exit Sub
    Else
        txtnomor.Text = Str(bantu!nomor)
    End If
End Sub

Sub hapus_list()
    lsBind.Clear
    lsBing.Clear
    lsBio.Clear
    lsEko.Clear
    lsFis.Clear
    lsGeo.Clear
    lsIPAT.Clear
    lsIPST.Clear
    lsKim.Clear
    lsMD.Clear
    lsMI.Clear
    lsSej.Clear
    
End Sub
Sub hitung_list()
    jumBind.Caption = lsBind.ListCount
    If lsBind.ListCount > 25 Then
        psnbind.Caption = "Lebih"
     ElseIf lsBind.ListCount < 25 Then
        psnbind.Caption = "Kurang"
     ElseIf lsBind.ListCount = 25 Then
        psnbind.Caption = "Ok"
    End If
    jumBing.Caption = lsBing.ListCount
    If lsBing.ListCount > 25 Then
        psnBing.Caption = "Lebih"
     ElseIf lsBing.ListCount < 25 Then
        psnBing.Caption = "Kurang"
     ElseIf lsBing.ListCount = 25 Then
        psnBing.Caption = "Ok"
    End If
    JumBio.Caption = lsBio.ListCount
    If lsBio.ListCount > 15 Then
        psnbio.Caption = "Lebih"
     ElseIf lsBio.ListCount < 15 Then
        psnbio.Caption = "Kurang"
     ElseIf lsBio.ListCount = 15 Then
        psnbio.Caption = "Ok"
    End If
    JumEko.Caption = lsEko.ListCount
    If lsEko.ListCount > 20 Then
        psneko.Caption = "Lebih"
    ElseIf lsEko.ListCount < 20 Then
        psneko.Caption = "Kurang"
     ElseIf lsEko.ListCount = 20 Then
        psneko.Caption = "Ok"
    End If
    jumFis.Caption = lsFis.ListCount
    If lsFis.ListCount > 15 Then
        psnfis.Caption = "Lebih"
     ElseIf lsFis.ListCount < 15 Then
        psnfis.Caption = "Kurang"
     ElseIf lsFis.ListCount = 15 Then
        psnfis.Caption = "Ok"
    End If
    JumGeo.Caption = lsGeo.ListCount
    If lsGeo.ListCount > 20 Then
        psngeo.Caption = "Lebih"
     ElseIf lsGeo.ListCount < 20 Then
        psngeo.Caption = "Kurang"
     ElseIf lsGeo.ListCount = 20 Then
        psngeo.Caption = "Ok"
    End If
    JumIPAT.Caption = lsIPAT.ListCount
    If lsIPAT.ListCount > 15 Then
        psnIPAT.Caption = "Lebih"
     ElseIf lsIPAT.ListCount < 15 Then
        psnIPAT.Caption = "Kurang"
     ElseIf lsIPAT.ListCount = 15 Then
        psnIPAT.Caption = "Ok"
    End If
    JumIPST.Caption = lsIPST.ListCount
    If lsIPST.ListCount > 15 Then
        psnIPST.Caption = "Lebih"
     ElseIf lsIPST.ListCount < 15 Then
        psnIPST.Caption = "Kurang"
     ElseIf lsIPST.ListCount = 15 Then
        psnIPST.Caption = "Ok"
    End If
    jumKim.Caption = lsKim.ListCount
    If lsKim.ListCount > 15 Then
        psnkim.Caption = "Lebih"
     ElseIf lsKim.ListCount < 15 Then
        psnkim.Caption = "Kurang"
     ElseIf lsKim.ListCount = 15 Then
        psnkim.Caption = "Ok"
    End If
    JumMD.Caption = lsMD.ListCount
    If lsMD.ListCount > 25 Then
        psnmd.Caption = "Lebih"
     ElseIf lsMD.ListCount < 25 Then
        psnmd.Caption = "Kurang"
     ElseIf lsMD.ListCount = 25 Then
        psnmd.Caption = "Ok"
    End If
    jumMI.Caption = lsMI.ListCount
    If lsMI.ListCount > 15 Then
        psnMI.Caption = "Lebih"
    ElseIf lsMI.ListCount < 15 Then
        psnMI.Caption = "Kurang"
     ElseIf lsMI.ListCount = 15 Then
        psnMI.Caption = "Ok"
    End If
    JumSej.Caption = lsSej.ListCount
    If lsSej.ListCount > 20 Then
        psnsej.Caption = "Lebih"
      ElseIf lsSej.ListCount < 20 Then
        psnsej.Caption = "Kurang"
     ElseIf lsSej.ListCount = 20 Then
        psnsej.Caption = "Ok"
    End If
    
    totKD.Caption = Str(Int(jumBind) + Int(jumBing) + Int(JumMD))
    TotKIPA.Caption = Str(Int(JumBio) + Int(jumFis) + Int(jumKim) + Int(JumIPAT) + Int(jumMI))
    TotKIPS.Caption = Str(Int(JumGeo) + Int(JumSej) + Int(JumEko) + Int(JumIPST))
    
End Sub
Sub tampil_bhsind()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Bahasa Indonesia' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsBind.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop
End Sub

Sub tampil_bhsing()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Bahasa Inggris' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsBing.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub
Sub tampil_matdas()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Matematika Dasar' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsMD.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub

Sub tampil_fisika()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Fisika' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsFis.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub
Sub tampil_Biologi()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Biologi' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsBio.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub

Sub tampil_kimia()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Kimia' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsKim.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub
Sub tampil_matIPA()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Matematika IPA' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsMI.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub
Sub tampil_IPAT()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='IPA Terpadu' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsIPAT.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub
Sub tampil_geografi()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Geografi' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsGeo.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub
Sub tampil_ekonomi()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Ekonomi' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsEko.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub
Sub tampil_sejarah()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='Sejarah' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsSej.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub
Sub tampil_IPST()
    perintah = "SELECT bid_studi.* ,soal.* FROM soal,bid_studi " _
                & " WHERE soal.kd_bidang=bid_studi.kd_bidang AND bid_studi.nm_bidang='IPS Terpadu' " _
                & " AND soal.kd_soal = '" & cari & "'"
    Set bidang = konekdb.Execute(perintah)
    
    Do Until bidang.EOF
    lsIPST.AddItem bidang!kd_soal
    bidang.MoveNext
    Loop

End Sub

Private Sub psneko_Click()

End Sub

•	Form Fbidang
Dim kdjurusan As String

Private Sub cbjurusan_Change()
ntah = "SELECT * FROM jurusan WHERE nm_jurusan='" & cbjurusan & "'"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
    End With
End Sub

Private Sub cbjurusan_Click()
   
    perintah = "SELECT * FROM jurusan WHERE nm_jurusan='" & cbjurusan & "'"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
    End With
End Sub

Private Sub cmedit_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txtbidang.Text = "" Then
        MsgBox "bidang studi kosong", vbInformation, "informasi"
        txtbidang.SetFocus
    Else
        perintah = "UPDATE bid_studi SET nm_bidang='" & txtbidang & "',kd_jurusan='" & kdjurusan & "' WHERE kd_bidang='" & txtkode & "'"
        Set bidang = konekdb.Execute(perintah)
        MsgBox "Data sudah diubah!!", vbInformation, "informasi"
        Call Form_Load
        
    End If

End Sub

Private Sub cmhapus_Click()
    
        If MsgBox("Anda yakin akan menghapus kode " & txtkode & " ??", vbYesNo, "informasi") = vbYes Then
            perintah = "DELETE FROM bid_studi WHERE kd_bidang='" & txtkode & "'"
            Set bidang = konekdb.Execute(perintah)
            MsgBox "data sudah terhapus", vbInformation, "informasi"
            bersih
            Call Form_Load
        End If

End Sub

Private Sub cmkeluar_Click()
    bidang.Close
    Unload Me
End Sub

Private Sub cmsimpan_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txtbidang.Text = "" Then
        MsgBox "bidang studi kosong", vbInformation, "informasi"
        txtbidang.SetFocus
    Else
        perintah = "INSERT INTO bid_studi (kd_bidang,nm_bidang,kd_jurusan) VALUES ('" & txtkode & _
                    "','" & txtbidang & "','" & kdjurusan & "')"
        Set bidang = konekdb.Execute(perintah)
        MsgBox "data sudah tersimpan", vbInformation, "informasi"
        Call Form_Load
        bersih
    End If
End Sub

Private Sub cmtambah_Click()
    Call tambah
    bukateks
    bukatombol
    cmtambah.Enabled = False
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd

    Call dbumptn.buka
    Call tampil_bidang
    Call tampiljurusan
    kunciteks
    kuncitombol
    cmtambah.Enabled = True

End Sub
Sub tampiljurusan()
    cbjurusan.Clear
    perintah = "SELECT * FROM jurusan ORDER BY kd_jurusan"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            cbjurusan.AddItem !nm_jurusan
            .MoveNext
            Loop
        End If
    End With
End Sub
Sub bersih()
    txtkode.Text = ""
    txtbidang.Text = ""
    
End Sub

Sub kuncitombol()
    cmtambah.Enabled = False
    cmsimpan.Enabled = False
    cmedit.Enabled = False
    cmhapus.Enabled = False
End Sub

Sub bukatombol()
    cmtambah.Enabled = True
    cmsimpan.Enabled = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
End Sub

Sub kunciteks()
    txtkode.Locked = True
    txtbidang.Locked = True
End Sub

Sub bukateks()
    txtkode.Locked = False
    txtbidang.Locked = False
End Sub
Sub tampil_bidang()

Dim item As MSComctlLib.ListItem
Dim No As Integer

perintah = "select B.*,J.* from jurusan J,bid_studi B WHERE J.kd_jurusan=B.kd_jurusan Order by B.kd_bidang"
Set bidang = konekdb.Execute(perintah)

lsbidang.ListItems.Clear
With lsbidang
    .ColumnHeaders.Clear
    .View = lvwReport
    .FullRowSelect = True
    .GridLines = True
    .LabelEdit = lvwManual
    .ColumnHeaders.Add , , "No", 30
    .ColumnHeaders.Add , , "Kode", 50
    .ColumnHeaders.Add , , "Nama bidang", 260
    .ColumnHeaders.Add , , "Jurusan", 260

End With

Do While Not bidang.EOF
    No = No + 1
    Set item = lsbidang.ListItems.Add(, , No)
    item.ListSubItems.Add , , bidang!kd_bidang
    item.ListSubItems.Add , , bidang!nm_bidang
    item.ListSubItems.Add , , bidang!nm_jurusan
    bidang.MoveNext
    
Loop

End Sub
Sub tambah()

Dim nomor As String
     
    With bidang
        If .RecordCount = 0 Then
            txtkode.Text = "BS001"
        Else
            .MoveLast
            nomor = !kd_bidang
            nomor = Right(nomor, 3)
            nomor = Val(nomor) + 1001
            nomor = Str(nomor)
            nomor = Right(nomor, 3)
            
            txtkode.Text = "BS" + nomor
                    
        End If
    End With
End Sub

Private Sub lsbidang_Click()
   Dim nmjurusan As String
    
    If lsbidang.ListItems.Count = 0 Then
        MsgBox "data masih kosong!", vbInformation, "informasi"
    Else
        txtkode.Text = lsbidang.ListItems(lsbidang.SelectedItem.Index).SubItems(1)
        txtbidang.Text = lsbidang.ListItems(lsbidang.SelectedItem.Index).SubItems(2)
        nmjurusan = lsbidang.ListItems(lsbidang.SelectedItem.Index).SubItems(3)
        
        perintah = "SELECT * FROM jurusan WHERE nm_jurusan='" & nmjurusan & "'"
        Set jurusan = konekdb.Execute(perintah)
        With jurusan
            If .EOF And .BOF Then
                Exit Sub
            Else
                cbjurusan.Text = !nm_jurusan
            End If
        End With

    End If
    
    Call kuncitombol
    Call bukateks
    txtkode.Locked = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
    
End Sub

•	Form Fjurusan
Private Sub cmedit_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txtjurusan.Text = "" Then
        MsgBox "jurusan penyakit kosong", vbInformation, "informasi"
        txtjurusan.SetFocus
    Else
        perintah = "UPDATE jurusan SET nm_jurusan='" & txtjurusan & "' WHERE kd_jurusan='" & txtkode & "'"
        Set jurusan = konekdb.Execute(perintah)
        MsgBox "Data sudah diubah!!", vbInformation, "informasi"
        Call Form_Load
        
    End If

End Sub

Private Sub cmhapus_Click()
    
        If MsgBox("Anda yakin akan menghapus kode " & txtkode & " ??", vbYesNo, "informasi") = vbYes Then
            perintah = "DELETE FROM jurusan WHERE kd_jurusan='" & txtkode & "'"
            Set jurusan = konekdb.Execute(perintah)
            MsgBox "data sudah terhapus", vbInformation, "informasi"
            bersih
            Call Form_Load
        End If
      
End Sub

Private Sub cmkeluar_Click()
    jurusan.Close
    Unload Me
End Sub

Private Sub cmsimpan_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txtjurusan.Text = "" Then
        MsgBox "jurusan penyakit kosong", vbInformation, "informasi"
        txtjurusan.SetFocus
    Else
        perintah = "INSERT INTO jurusan (kd_jurusan,nm_jurusan) VALUES ('" & txtkode & _
                    "','" & txtjurusan & "')"
        Set jurusan = konekdb.Execute(perintah)
        MsgBox "data sudah tersimpan", vbInformation, "informasi"
        Call Form_Load
        bersih
    End If
End Sub

Private Sub cmtambah_Click()
    Call tambah
    bukateks
    bukatombol
    cmtambah.Enabled = False
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    Call tampil_jurusan
    kunciteks
    kuncitombol
    cmtambah.Enabled = True

End Sub

Sub bersih()
    txtkode.Text = ""
    txtjurusan.Text = ""
    
End Sub

Sub kuncitombol()
    cmtambah.Enabled = False
    cmsimpan.Enabled = False
    cmedit.Enabled = False
    cmhapus.Enabled = False
End Sub

Sub bukatombol()
    cmtambah.Enabled = True
    cmsimpan.Enabled = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
End Sub

Sub kunciteks()
    txtkode.Locked = True
    txtjurusan.Locked = True
End Sub

Sub bukateks()
    txtkode.Locked = False
    txtjurusan.Locked = False
End Sub
Sub tampil_jurusan()

Dim item As MSComctlLib.ListItem
Dim No As Integer

perintah = "select * from jurusan Order by kd_jurusan"
Set jurusan = konekdb.Execute(perintah)

lsjurusan.ListItems.Clear
With lsjurusan
    .ColumnHeaders.Clear
    .View = lvwReport
    .FullRowSelect = True
    .GridLines = True
    .LabelEdit = lvwManual
    .ColumnHeaders.Add , , "No", 30
    .ColumnHeaders.Add , , "Kode", 50
    .ColumnHeaders.Add , , "Nama jurusan", 260

End With

Do While Not jurusan.EOF
    No = No + 1
    Set item = lsjurusan.ListItems.Add(, , No)
    item.ListSubItems.Add , , jurusan!kd_jurusan
    item.ListSubItems.Add , , jurusan!nm_jurusan
    jurusan.MoveNext
    
Loop

End Sub
Sub tambah()

Dim nomor As String
     
    With jurusan
        If .RecordCount = 0 Then
            txtkode.Text = "JR001"
        Else
            .MoveLast
            nomor = !kd_jurusan
            nomor = Right(nomor, 3)
            nomor = Val(nomor) + 1001
            nomor = Str(nomor)
            nomor = Right(nomor, 3)
            
            txtkode.Text = "JR" + nomor
                    
        End If
    End With
End Sub

Private Sub lsjurusan_Click()
    If lsjurusan.ListItems.Count = 0 Then
        MsgBox "data masih kosong!", vbInformation, "informasi"
    Else
        txtkode.Text = lsjurusan.ListItems(lsjurusan.SelectedItem.Index).SubItems(1)
        txtjurusan.Text = lsjurusan.ListItems(lsjurusan.SelectedItem.Index).SubItems(2)
    End If
    
    Call kuncitombol
    Call bukateks
    txtkode.Locked = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
    
End Sub

•	Form Flaphasil
Public nopeserta As String

Private Sub cbnopeserta_Change()
perintah = "SELECT * FROM peserta WHERE no_peserta='" & cbnopeserta & "'"
   Set peserta = konekdb.Execute(perintah)
   With peserta
        If .EOF And .BOF Then
            Exit Sub
        Else
            nopeserta = !no_peserta
        End If
   End With
   Call tampil_peserta
   Call jawaban_umum
   Call jawaban_ipa
   Call jawaban_ips
   Call grade_umum
   Call grade_ipa
   Call grade_ips
   Call tampil_grade
End Sub

Private Sub cbnopeserta_Click()
 perintah = "SELECT * FROM peserta WHERE no_peserta='" & cbnopeserta & "'"
   Set peserta = konekdb.Execute(perintah)
   With peserta
        If .EOF And .BOF Then
            Exit Sub
        Else
            nopeserta = !no_peserta
        End If
   End With
   Call tampil_peserta
   Call jawaban_umum
   Call jawaban_ipa
   Call jawaban_ips
   Call grade_umum
   Call grade_ipa
   Call grade_ips
   Call tampil_grade
End Sub
Sub tampil_grade()
    perintah = "SELECT * FROM hasil WHERE no_peserta='" & nopeserta & "'"
    Set hasil = konekdb.Execute(perintah)
    
    lbgradesemua.Caption = hasil!skor
    lbstatushasil.Caption = hasil!Status
    If hasil!kd_prodi = "" Then
        lbuniv.Visible = False
        lbprodi.Visible = False
    Else
        perintah = "SELECT * FROM universitas,prodi WHERE universitas.kd_universitas=prodi.kd_universitas AND prodi.kd_prodi='" & hasil!kd_prodi & "'"
        Set prodi = konekdb.Execute(perintah)
        lbuniv.Visible = True
        lbprodi.Visible = True
        lbuniv.Caption = prodi!nm_universitas
        lbprodi.Caption = prodi!nm_prodi
        
    End If
End Sub
Sub tampil_peserta()
    perintah = "SELECT * FROM peserta WHERE no_peserta='" & nopeserta & "'"
    Set peserta = konekdb.Execute(perintah)
    
    lblnama.Caption = peserta!nama
    If peserta!kd_jurusan = "JR001" Then
        lbkel.Caption = "IPA"
    ElseIf peserta!kd_jurusan = "JR002" Then
        lbkel.Caption = "IPS"
    Else
        lbkel.Caption = "IPC"
    End If
End Sub

Private Sub cmkeluar_Click()
Unload Me
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
 
 perintah = "SELECT * FROM peserta WHERE sts='hasil' ORDER BY no_peserta"
 Set peserta = konekdb.Execute(perintah)
 Do Until peserta.EOF
    cbnopeserta.AddItem peserta!no_peserta
    peserta.MoveNext
 Loop
End Sub

Sub grade_umum()
    
    'grade umum
    perintah = "SELECT SUM(jawaban_tes.nilai) as grade FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR003' GROUP BY jawaban_tes.no_peserta"
    Set bantu = konekdb.Execute(perintah)
    lblgradeku.Caption = Str(bantu!grade)
    'jawaban benar
    perintah1 = "SELECT COUNT(jawaban_tes.nilai) as benar FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR003' AND jawaban_tes.nilai=4 "
    Set bantu1 = konekdb.Execute(perintah1)
    lblbenarku.Caption = Str(bantu1!benar)
    'jawaban salah
    perintah2 = "SELECT COUNT(jawaban_tes.nilai) as salah FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR003' AND jawaban_tes.nilai=-1 "
    Set bantu2 = konekdb.Execute(perintah2)
    lblsalahku.Caption = Str(bantu2!salah)
    
    'jawaban kosong
    lblkosongku.Caption = Str(Int(lbljumsoal) - (Int(lblsalah) + Int(lblbenar)))
    
End Sub
Sub grade_ipa()

    perintah = "SELECT SUM(jawaban_tes.nilai) as grade FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR001' GROUP BY jawaban_tes.no_peserta"
    Set bantu = konekdb.Execute(perintah)
    If bantu.EOF And bantu.BOF Then
        Exit Sub
    Else
    
    lblgradeipa.Caption = Str(bantu!grade)
    End If
    'jawaban benar
    perintah1 = "SELECT COUNT(jawaban_tes.nilai) as benar FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR001' AND jawaban_tes.nilai=4 "
    Set bantu1 = konekdb.Execute(perintah1)
    lblbenaripa.Caption = Str(bantu1!benar)
    'jawaban salah
    perintah2 = "SELECT COUNT(jawaban_tes.nilai) as salah FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR001' AND jawaban_tes.nilai=-1 "
    Set bantu2 = konekdb.Execute(perintah2)
    lblsalahipa.Caption = Str(bantu2!salah)
    
    'jawaban kosong
    lblkosongipa.Caption = Str(Int(lbljumsoal) - (Int(lblsalah) + Int(lblbenar)))
    
End Sub
Sub grade_ips()
    
    perintah = "SELECT SUM(jawaban_tes.nilai) as grade FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR002' GROUP BY jawaban_tes.no_peserta"
    Set bantu = konekdb.Execute(perintah)
    If bantu.EOF And bantu.BOF Then
        Exit Sub
    Else
    lblgradeips.Caption = Str(bantu!grade)
    End If
    'jawaban benar
    perintah1 = "SELECT COUNT(jawaban_tes.nilai) as benar FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR002' AND jawaban_tes.nilai=4 "
    Set bantu1 = konekdb.Execute(perintah1)
    lblbenarips.Caption = Str(bantu1!benar)
    'jawaban salah
    perintah2 = "SELECT COUNT(jawaban_tes.nilai) as salah FROM bank_soal,soal,jawaban_tes " _
                & " WHERE jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND bank_soal.kd_soal=soal.kd_soal AND jawaban_tes.no_peserta='" & nopeserta & _
                "' AND soal.kd_jurusan='JR002' AND jawaban_tes.nilai=-1 "
    Set bantu2 = konekdb.Execute(perintah2)
    lblsalahips.Caption = Str(bantu2!salah)
    
    'jawaban kosong
    lblkosongips.Caption = Str(Int(lbljumsoal) - (Int(lblsalah) + Int(lblbenar)))
End Sub
Sub jawaban_umum()
    'tampil jawaban
    lshasilku.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR003' AND jawaban_tes.no_peserta='" & nopeserta & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lshasilku.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub
Sub jawaban_ipa()
    'tampil jawaban
    lsIPA.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR001' AND jawaban_tes.no_peserta='" & nopeserta & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lsIPA.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub
Sub jawaban_ips()
    'tampil jawaban
    lsIPS.Clear
    perintah = "SELECT jurusan.*,soal.*,bank_soal.*,jawaban_tes.* FROM jurusan,soal,bank_soal,jawaban_tes " _
                & " WHERE jurusan.kd_jurusan=soal.kd_jurusan AND soal.kd_soal=bank_soal.kd_soal AND jawaban_tes.kd_bsoal=bank_soal.kd_bsoal AND" _
                & " soal.kd_jurusan ='JR002' AND jawaban_tes.no_peserta='" & nopeserta & "' ORDER BY bank_soal.nomor"
    Set bantu = konekdb.Execute(perintah)
    Do Until bantu.EOF
        lsIPS.AddItem bantu!nomor & ". " & bantu!jawab
    bantu.MoveNext
    Loop
End Sub

•	Form FLaporan

Private Sub cmhasil_Click()
Flaphasil.Show 1
End Sub

Private Sub cmlappeserta_Click()
    Call dbumptn.buka
    Call modLaporan.lappeserta
End Sub

Private Sub cmpeserta_Click()
Fpeserta.Show 1

End Sub

Private Sub cmprodi_Click()
flapprodi.Show 1
End Sub

Private Sub cmrecord_Click()
'Flaprecord.Show 1
End Sub

Private Sub Command1_Click()
    Load Flappertahun
    Flappertahun.Show 1
End Sub

Private Sub Command2_Click()
    Call dbumptn.buka
    Load Flaporanuniv
    Flaporanuniv.Show 1
End Sub

Private Sub Command4_Click()
    Load FlapPilihan
    FlapPilihan.Show 1
End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub Flaprecord_Click()

End Sub

Private Sub Command7_Click()

End Sub

Private Sub Command6_Click()
FLapProdiUniv.Show 1
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
End Sub

•	Form Flaporanuniv
Public kduniversitas As String
Private Sub cbuniversitas_Change()
    perintah = "SELECT * FROM universitas WHERE nm_universitas='" & cbuniversitas & "'"
   Set universitas = konekdb.Execute(perintah)
   With universitas
        If .EOF And .BOF Then
            Exit Sub
        Else
            kduniversitas = !kd_universitas
        End If
   End With
End Sub

Private Sub cbuniversitas_Click()
   perintah = "SELECT * FROM universitas WHERE nm_universitas='" & cbuniversitas & "'"
   Set universitas = konekdb.Execute(perintah)
   With universitas
        If .EOF And .BOF Then
            Exit Sub
        Else
            kduniversitas = !kd_universitas
        End If
   End With
End Sub

Private Sub cmproses_Click()
    Call dbumptn.buka
    Call modLaporan.lapunivprodi
    
End Sub

Private Sub Command1_Click()
    Unload Me
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
Call dbumptn.buka
    
    cbuniversitas.Clear
    perintah = "SELECT * FROM universitas ORDER BY kd_universitas"
    Set universitas = konekdb.Execute(perintah)
    With universitas
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            cbuniversitas.AddItem !nm_universitas
            .MoveNext
            Loop
        End If
    End With
End Sub

•	Form Flappertahun
Private Sub cmproses_Click()
    Call dbumptn.buka
    Call modLaporan.lappesertapertahun
End Sub

Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Form_Load()
Dim i As Integer

i = Right(Date, 4)

For i = i - 5 To i + 5
    cbtahun.AddItem i
Next i
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
End Sub

•	Form FlapPilihan
Private Sub Command1_Click()
Unload Me
End Sub

Private Sub cmproses_Click()
    Call dbumptn.buka
    Call modLaporan.laphasilprodi
    
End Sub

Private Sub Form_Load()
Dim i As Integer

i = Right(Date, 4)

For i = i - 5 To i + 5
    cbtahun.AddItem i
Next i
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd

cbpilihan.AddItem "Tidak Berhasil"
cbpilihan.AddItem "berhasil"
End Sub

•	Form flapprodi
Dim kduniversitas, kdprodi As String
Dim kdjurusan, kdbidang As String

Private Sub cmkeluarprodi_Click()
Unload Me
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
 Call dbumptn.buka
    Call tampil_prodi
    Call tampil_universitas
    lsprodi.ListItems.Clear
End Sub

Sub tampil_prodi()

Dim item As MSComctlLib.ListItem
Dim No As Integer
Dim jumlah As Integer
perintah = "select * from prodi WHERE kd_universitas='" & kduniversitas & "' ORDER by kd_prodi"
Set prodi = konekdb.Execute(perintah)

lsprodi.ListItems.Clear
Do While Not prodi.EOF
    No = No + 1
    perintah = "SELECT * FROM pilih_fak WHERE kd_prodi='" & prodi!kd_prodi & "' ORDER BY kd_prodi"
    Set bantu = konekdb.Execute(perintah)
    If bantu.EOF And bantu.BOF Then
        jumlah = 0
    Else
        jumlah = bantu.RecordCount
    End If
    Set item = lsprodi.ListItems.Add(, , No)
    item.ListSubItems.Add , , prodi!kd_prodi
    item.ListSubItems.Add , , prodi!nm_prodi
    item.ListSubItems.Add , , prodi!grade
    item.ListSubItems.Add , , bantu.RecordCount
    item.ListSubItems.Add , , prodi!kuota
    prodi.MoveNext
    
Loop

End Sub
Private Sub tampil_universitas()
cmuniversitas.Clear
    perintah = "SELECT * FROM universitas ORDER BY kd_universitas"
    Set universitas = konekdb.Execute(perintah)
    Do Until universitas.EOF
        cmuniversitas.AddItem universitas!nm_universitas
       universitas.MoveNext
    Loop
End Sub
Private Sub cmuniversitas_Click()
perintah = "SELECT * FROM universitas WHERE nm_universitas='" & cmuniversitas & "'"
   Set universitas = konekdb.Execute(perintah)
   With universitas
        If .EOF And .BOF Then
            Exit Sub
        Else
            kduniversitas = !kd_universitas
        End If
   End With
   Call tampil_universitas
   Call tampil_prodi
End Sub

•	Form flogin
Private Sub cmbatal_Click()
    bersih
  
End Sub

Sub bersih()
    txtnama.Text = ""
    txtkunci.Text = ""
    txtnama.SetFocus
End Sub

Private Sub cmkeluar_Click()
    Unload Me
    
End Sub

Private Sub cmlogin_Click()
      perintah = "SELECT * FROM admin WHERE admin='" & txtnama & "' AND kunci='" & txtkunci & "'"
    Set admin = konekdb.Execute(perintah)
       If txtnama.Text = "" Then
        MsgBox "Nama admin masih kosong", vbInformation, "informasi"
        txtnama.SetFocus
    ElseIf txtkunci.Text = "" Then
        MsgBox "kata kunci masih kosong", vbInformation, "informasi"
        txtkunci.SetFocus
    ElseIf admin.RecordCount = 0 Then
        MsgBox "Nama dan katakunci anda salah ", vbInformation, "informasi"
        bersih
    Else
        'MsgBox "Anda berhasil masuk", vbInformation, "informasi"
        Unload Me
        FMenuUtama.adminmasuk
        FMenuUtama.Show
    End If
    
End Sub

Private Sub Form_Load()
  Call dbumptn.buka
  'adminkeluar
  Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
End Sub

•	Form FMenuUtama
Dim Lokasi As String

Private Sub cmabout_Click()
Fabout.Show 1
End Sub

Private Sub cmdaftar_Click()
 Load Fdaftar
 Fdaftar.Show 1

End Sub

Private Sub cmbank_Click()
  Load Fbank
    Fbank.Show 1
End Sub

Private Sub cmbidang_Click()
 Load Fbidang
    Fbidang.Show 1
End Sub

Private Sub cmexit_Click()
Unload Me
End Sub

Private Sub cmloginA_Click()
flogin.Show 1
End Sub

Private Sub cmloginP_Click()
Floginuser.Show 1
End Sub

Private Sub Command5_Click()

End Sub

Private Sub cmjur_Click()
  Load Fjurusan
    Fjurusan.Show 1
End Sub

Private Sub cmprodi_Click()
 Load Fprodi
    Fprodi.Show 1
End Sub

Private Sub cmreport_Click()
FLaporan.Show 1
End Sub

Private Sub cmsoal_Click()
  Load Fsoal
    Fsoal.Show 1
End Sub

Private Sub cmtipe_Click()
 Load Ftipe
    Ftipe.Show 1
End Sub

Private Sub cmuniv_Click()
Load Funiversitas
    Funiversitas.Show 1
End Sub

Private Sub Command3_Click()
 Load Fbidang
    Fbidang.Show 1
End Sub

Private Sub Form_Load()
FMenuUtama.Show
 Lokasi = App.Path
 Skin1.LoadSkin Lokasi + "\skin\media.skn"
 Skin1.ApplySkin hWnd
 Call dbumptn.buka
  adminkeluar
End Sub

Private Sub mnbank_Click()
    Load Fbank
    Fbank.Show 1
    
End Sub

Private Sub mnbidang_Click()
     Load Fbidang
    Fbidang.Show 1
End Sub

Private Sub mndaftar_Click()
    Load Fdaftar
    Fdaftar.Show 1
End Sub

Private Sub mnjurusan_Click()
    Load Fjurusan
    Fjurusan.Show 1
    
End Sub

Private Sub mnkelompok_Click()
    Load Fkelompok
    Fkelompok.Show 1
End Sub

Private Sub mnkeluar_Click()
    End
End Sub

Private Sub mnlogin_Click()
    Load flogin
    flogin.Show
    
End Sub

Sub adminmasuk()
    mnlogin.Enabled = False
    mnlogout.Enabled = True
    mnmasukan.Visible = True
    mntes.Visible = False
    'mnadmin.Visible = False
   ' mnmasukan.Visible = False
    
End Sub

Sub adminkeluar()
    mnlogin.Enabled = True
    mnlogout.Enabled = False
    mnmasukan.Visible = False
    mntes.Visible = True
End Sub

Private Sub mnloginpeserta_Click()
    Load Floginuser
    Floginuser.Show 1
End Sub

Private Sub mnlogout_Click()
    adminkeluar
End Sub

Private Sub mnprodi_Click()
    Load Fprodi
    Fprodi.Show 1
End Sub

Private Sub mnsoal_Click()
    Load Fsoal
    Fsoal.Show 1
End Sub

Private Sub mntipe_Click()
    Load Ftipe
    Ftipe.Show 1
End Sub

Private Sub mnuniversitas_Click()
    Load Funiversitas
    Funiversitas.Show 1
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)

End Sub

Private Sub RichTextBox1_Change()

End Sub

•	Form Fpeserta
Dim kduniversitas, kdprodi As String
Dim kdjurusan, kdbidang As String
Private Sub cbkeluarpeserta_Click()
Unload Me
End Sub
Private Sub cmnomor_Click()
     lsprodidata.Clear
      lsuniv.Clear
    perintah = "select * from peserta where no_peserta='" & cmnomor & "'"
    Set peserta = konekdb.Execute(perintah)
    lbnamapeserta.Caption = peserta!nama
    lbpassword.Caption = peserta!Password
      If peserta!kd_jurusan = "JR001" Then
        lbjurusan.Caption = "IPA"
      ElseIf peserta!kd_jurusan = "JR002" Then
        lbjurusan.Caption = "IPS"
      ElseIf peserta!kd_jurusan = "JR003" Then
        lbjurusan.Caption = "IPC"
      End If
     lbllahir.Caption = peserta!tmpt_lahir
     lbltgllahir.Caption = peserta!tgl_lahir
     lblalamat.Caption = peserta!almt_asal
     lblsekolah.Caption = peserta!nm_sklh
     lblalmtsklh.Caption = peserta!almt_sklh
     
     perintah = "select * from universitas,prodi, pilih_fak " _
                & "where universitas.kd_universitas=prodi.kd_universitas " _
                & "and prodi.kd_prodi=pilih_fak.kd_prodi and " _
                & "pilih_fak.no_peserta='" & cmnomor & "' order by pilih_fak.id_pilih"
     Set pilihfak = konekdb.Execute(perintah)
     Do Until pilihfak.EOF
          lsuniv.AddItem pilihfak!nm_universitas
          lsprodidata.AddItem pilihfak!nm_prodi
          pilihfak.MoveNext
     Loop
     lbunivpil1.Caption = lsuniv.List(0)
     lbunivpil2.Caption = lsuniv.List(1)
     lbunivpil3.Caption = lsuniv.List(2)
     lbprodipil1.Caption = lsprodidata.List(0)
     lbprodipil2.Caption = lsprodidata.List(1)
     lbprodipil3.Caption = lsprodidata.List(2)
   End Sub
Sub tampil_peserta()
perintah = "select * from peserta order by no_peserta "
Set peserta = konekdb.Execute(perintah)
    cmnomor.Clear
    Do Until peserta.EOF
      cmnomor.AddItem peserta!no_peserta
      peserta.MoveNext
      
    Loop
    
End Sub

Private Sub Form_Load()
Call dbumptn.buka
    Call tampil_peserta
   Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
 lsprodidata.Clear
 lsuniv.Clear
End Sub

•	Form Fprodi
Dim kduniversitas As String
Dim kdjurusan As String

Private Sub cbjurusan_Change()
    If cbjurusan.Text = "IPA" Then
        kdjurusan = "JR001"
    ElseIf cbjurusan.Text = "IPS" Then
        kdjurusan = "JR002"
    End If
    
    'perintah = "SELECT * FROM jurusan WHERE nm_jurusan='" & cbjurusan & "'"
    'Set jurusan = konekdb.Execute(perintah)
    'With jurusan
        'If .EOF And .BOF Then
         '   Exit Sub
        'Else
         '   kdjurusan = !kd_jurusan
       ' End If
   ' End With
End Sub

Private Sub cbjurusan_Click()
   If cbjurusan.Text = "IPA" Then
        kdjurusan = "JR001"
    ElseIf cbjurusan.Text = "IPS" Then
        kdjurusan = "JR002"
    End If
    
   ' perintah = "SELECT * FROM jurusan WHERE nm_jurusan='" & cbjurusan & "'"
   ' Set jurusan = konekdb.Execute(perintah)
   ' With jurusan
     '   If .EOF And .BOF Then
      '      Exit Sub
       ' Else
        '    kdjurusan = !kd_jurusan
      '  End If
   ' End With
End Sub

Private Sub cbuniversitas_Change()
    perintah = "SELECT * FROM universitas WHERE nm_universitas='" & cbuniversitas & "'"
   Set universitas = konekdb.Execute(perintah)
   With universitas
        If .EOF And .BOF Then
            Exit Sub
        Else
            kduniversitas = !kd_universitas
        End If
   End With
End Sub

Private Sub cbuniversitas_Click()
   perintah = "SELECT * FROM universitas WHERE nm_universitas='" & cbuniversitas & "'"
   Set universitas = konekdb.Execute(perintah)
   With universitas
        If .EOF And .BOF Then
            Exit Sub
        Else
            kduniversitas = !kd_universitas
        End If
   End With
End Sub

Private Sub cmedit_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txtprodi.Text = "" Then
        MsgBox "prodi masih kosong", vbInformation, "informasi"
        txtprodi.SetFocus
    Else
        perintah = "UPDATE prodi SET nm_prodi='" & txtprodi & "',grade='" & txtgrade & "',kd_universitas='" & kduniversitas & "',kd_jurusan='" & kdjurusan & "',kuota='" & txtkuota & "' WHERE kd_prodi='" & txtkode & "'"
        Set prodi = konekdb.Execute(perintah)
        MsgBox "Data sudah diubah!!", vbInformation, "informasi"
        Call Form_Load
        
    End If

End Sub

Private Sub cmhapus_Click()
    
        If MsgBox("Anda yakin akan menghapus kode " & txtkode & " ??", vbYesNo, "informasi") = vbYes Then
            perintah = "DELETE FROM prodi WHERE kd_prodi='" & txtkode & "'"
            Set prodi = konekdb.Execute(perintah)
            MsgBox "data sudah terhapus", vbInformation, "informasi"
            bersih
            Call Form_Load
        End If

    
End Sub

Private Sub cmkeluar_Click()
    prodi.Close
    Unload Me
End Sub

Private Sub cmsimpan_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txtprodi.Text = "" Then
        MsgBox "prodi masih kosong", vbInformation, "informasi"
        txtprodi.SetFocus
    Else
        perintah = "INSERT INTO prodi (kd_prodi,nm_prodi,kd_universitas,grade,kd_jurusan,kuota) VALUES ('" & txtkode & _
                    "','" & txtprodi & "','" & kduniversitas & "','" & txtgrade & "','" & kdjurusan & "','" & txtkuota & "')"
        Set prodi = konekdb.Execute(perintah)
        MsgBox "data sudah tersimpan", vbInformation, "informasi"
        Call Form_Load
        bersih
    End If
End Sub

Private Sub cmtambah_Click()
    bersih
    Call tambah
    
    bukateks
    bukatombol
    cmtambah.Enabled = False
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    Call tampil_prodi
    Call tampiljurusan
    bersih
    cbuniversitas.Clear
    perintah = "SELECT * FROM universitas ORDER BY kd_universitas"
    Set universitas = konekdb.Execute(perintah)
    With universitas
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            cbuniversitas.AddItem !nm_universitas
            .MoveNext
            Loop
        End If
    End With
    kunciteks
    kuncitombol
    cmtambah.Enabled = True
    
End Sub

Sub tampiljurusan()
    cbjurusan.Clear
    cbjurusan.AddItem "IPA"
    cbjurusan.AddItem "IPS"
    'perintah = "SELECT * FROM jurusan ORDER BY kd_jurusan"
   ' Set jurusan = konekdb.Execute(perintah)
    'With jurusan
     '   If .EOF And .BOF Then
      '      Exit Sub
       ' Else
        '    Do Until .EOF
         '   cbjurusan.AddItem !nm_jurusan
          '  .MoveNext
           ' Loop
       ' End If
    'End With
End Sub
Sub bersih()
    txtkode.Text = ""
    txtprodi.Text = ""
    txtgrade.Text = ""
    txtkuota.Text = ""
    cbjurusan.Text = ""
End Sub

Sub kuncitombol()
    cmtambah.Enabled = True
    cmsimpan.Enabled = False
    cmedit.Enabled = False
    cmhapus.Enabled = False
End Sub

Sub bukatombol()
    cmtambah.Enabled = True
    cmsimpan.Enabled = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
End Sub

Sub kunciteks()
    txtkode.Locked = True
    txtprodi.Locked = True
End Sub

Sub bukateks()
    txtkode.Locked = False
    txtprodi.Locked = False
End Sub
Sub tampil_prodi()

Dim item As MSComctlLib.ListItem
Dim No As Integer
perintah = "select universitas.*,prodi.* from prodi,universitas WHERE prodi.kd_universitas=universitas.kd_universitas Order by universitas.nm_universitas"
'perintah = "select universitas.*,prodi.* from prodi,universitas WHERE prodi.kd_universitas=universitas.kd_universitas Order by prodi.kd_prodi"
Set prodi = konekdb.Execute(perintah)

lsprodi.ListItems.Clear
With lsprodi
    .ColumnHeaders.Clear
    .View = lvwReport
    .FullRowSelect = True
    .GridLines = True
    .LabelEdit = lvwManual
    .ColumnHeaders.Add , , "No", 30
    .ColumnHeaders.Add , , "Kode", 50
    .ColumnHeaders.Add , , "Nama prodi", 260
    .ColumnHeaders.Add , , "Universitas", 200
    .ColumnHeaders.Add , , "Grade", 50
    .ColumnHeaders.Add , , "Kelompok", 85
    .ColumnHeaders.Add , , "Kuota", 50
    
End With

Do While Not prodi.EOF
    No = No + 1
    Set item = lsprodi.ListItems.Add(, , No)
    item.ListSubItems.Add , , prodi!kd_prodi
    item.ListSubItems.Add , , prodi!nm_prodi
    item.ListSubItems.Add , , prodi!nm_universitas
    item.ListSubItems.Add , , prodi!grade
    If prodi!kd_jurusan = "JR001" Then
        item.ListSubItems.Add , , "IPA"
    ElseIf prodi!kd_jurusan = "JR002" Then
        item.ListSubItems.Add , , "IPS"
    End If
    item.ListSubItems.Add , , prodi!kuota
    prodi.MoveNext
    
Loop

End Sub
Sub tambah()

Dim nomor As String
     
    With prodi
        If .RecordCount = 0 Then
            txtkode.Text = "PR001"
        Else
            .MoveLast
            nomor = !kd_prodi
            nomor = Right(nomor, 3)
            nomor = Val(nomor) + 1001
            nomor = Str(nomor)
            nomor = Right(nomor, 3)
            
            txtkode.Text = "PR" + nomor
                    
        End If
    End With
End Sub

Private Sub lsprodi_Click()
    If lsprodi.ListItems.Count = 0 Then
        MsgBox "data masih kosong!", vbInformation, "informasi"
    Else
        txtkode.Text = lsprodi.ListItems(lsprodi.SelectedItem.Index).SubItems(1)
        txtprodi.Text = lsprodi.ListItems(lsprodi.SelectedItem.Index).SubItems(2)
        txtgrade.Text = lsprodi.ListItems(lsprodi.SelectedItem.Index).SubItems(4)
        cbuniversitas.Text = lsprodi.ListItems(lsprodi.SelectedItem.Index).SubItems(3)
        cbjurusan.Text = lsprodi.ListItems(lsprodi.SelectedItem.Index).SubItems(5)
        txtkuota.Text = lsprodi.ListItems(lsprodi.SelectedItem.Index).SubItems(6)
    End If
    
    Call kuncitombol
    Call bukateks
    txtkode.Locked = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
    
End Sub

•	Form Fsoal
Dim kdjurusan, kdtipe, kdbidang As String
Dim tgambar, tsoal As String

Private Sub cbbidang_Change()
    perintah = "SELECT * FROM bid_studi WHERE nm_bidang='" & cbbidang & "'"
    Set bidang = konekdb.Execute(perintah)
    With bidang
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdbidang = !kd_bidang
            
        End If
    End With
End Sub

Private Sub cbbidang_Click()
    perintah = "SELECT * FROM bid_studi WHERE nm_bidang='" & cbbidang & "'"
    Set bidang = konekdb.Execute(perintah)
    With bidang
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdbidang = !kd_bidang
            
        End If
    End With
End Sub

Private Sub cbjurusan_Change()
     perintah = "SELECT * FROM jurusan WHERE nm_jurusan='" & cbjurusan & "'"
   Set jurusan = konekdb.Execute(perintah)
   With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
   End With
   Call tampil_bidang
End Sub

Private Sub cbjurusan_Click()
    perintah = "SELECT * FROM jurusan WHERE nm_jurusan='" & cbjurusan & "'"
   Set jurusan = konekdb.Execute(perintah)
   With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdjurusan = !kd_jurusan
        End If
   End With
   Call tampil_bidang
   
End Sub

Private Sub cbtipe_Change()
    perintah = "SELECT * FROM tipe_soal WHERE nm_tipe='" & cbtipe & "'"
   Set tipe = konekdb.Execute(perintah)
   With tipe
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdtipe = !kd_tipe
        End If
   End With
End Sub

Private Sub cbtipe_Click()
    perintah = "SELECT * FROM tipe_soal WHERE nm_tipe='" & cbtipe & "'"
   Set tipe = konekdb.Execute(perintah)
   With tipe
        If .EOF And .BOF Then
            Exit Sub
        Else
            kdtipe = !kd_tipe
        End If
   End With
End Sub

Private Sub cmambilgambar_Click()
    With CDgambar
    .Filter = " Soal Gambar |*.bmp;*.JPEG;*.jpg;*.gif;"
    .DialogTitle = "Mengambil Soal Gambar"
    .ShowOpen
    imgsoal.Picture = LoadPicture(.FileName)
    'rbsoal.LoadFile .FileName
    txtgambar.Text = .FileName
    End With
End Sub

Private Sub cmambilsoal_Click()
    With CDsoal
    .Filter = " File Richtext |*.rtf;"
    .DialogTitle = "Mengambil Soal Umptn"
    .ShowOpen
    'gambar.Picture = LoadPicture(.FileName)
    rbsoal.LoadFile .FileName
    txtfile.Text = .FileName
    
End With
End Sub

Private Sub cmedit_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf rbsoal.Text = "" Then
        MsgBox "soal masih kosong", vbInformation, "informasi"
        rbsoal.SetFocus
    Else
        Call simpansoal
        tsoal = Right(txtfile.Text, 9)
        tgambar = Right(txtgambar.Text, 9)
        
        perintah = "UPDATE soal SET soal='" & tsoal & "',kd_jurusan='" & kdjurusan & "',kd_bidang='" & kdbidang & "'," & _
        " kd_tipe='" & kdtipe & "',jawaban='" & cbjawaban & "',gambar='" & tgambar & "' WHERE kd_soal='" & txtkode & "'"
        Set soal = konekdb.Execute(perintah)
        MsgBox "Data sudah diubah!!", vbInformation, "informasi"
        Call Form_Load
        
    End If

End Sub

Sub simpansoal()
    rbsoal.SaveFile txtfile.Text
End Sub
Private Sub cmhapus_Click()
    
        If MsgBox("Anda yakin akan menghapus kode " & txtkode & " ??", vbYesNo, "informasi") = vbYes Then
            perintah = "DELETE FROM soal WHERE kd_soal='" & txtkode & "'"
            Set soal = konekdb.Execute(perintah)
            MsgBox "data sudah terhapus", vbInformation, "informasi"
            bersih
            Call Form_Load
        End If

    
End Sub

Private Sub cmkeluar_Click()
    soal.Close
    Unload Me
End Sub

Private Sub cmsimpan_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf rbsoal.Text = "" Then
        MsgBox "soal kosong", vbInformation, "informasi"
        rbsoal.SetFocus
    Else
        tsoal = Right(txtfile.Text, 9)
        tgambar = Right(txtgambar.Text, 9)
                
        perintah = "INSERT INTO soal (kd_soal,soal,kd_jurusan,kd_tipe,kd_bidang,jawaban,gambar) " _
        & " VALUES ('" & txtkode & "','" & tsoal & "','" & kdjurusan & "','" & kdtipe & "','" & kdbidang & "','" & cbjawaban & "','" & tgambar & "')"
        Set soal = konekdb.Execute(perintah)
        MsgBox "data sudah tersimpan", vbInformation, "informasi"
        Call Form_Load
        bersih
    End If
End Sub

Private Sub cmtambah_Click()
    Call bersih
    Call tambah
    bukateks
    bukatombol
    cmtambah.Enabled = False
End Sub

Private Sub btnSaveFile_Click()
    Dim strFileName As String
    
    dlgCommonDialog1.Filter = "RTF (*.rtf)|*.rtf|Text (*.txt)|*.txt"
    dlgCommonDialog1.CancelError = True
    On Error GoTo CancelHandler
    dlgCommonDialog1.ShowSave
    strFileName = dlgCommonDialog1.FileName
    On Error GoTo ErrorHandler
    If dlgCommonDialog1.FilterIndex = 1 Then
        rbsoal.SaveFile strFileName, rtfRTF
    Else
        rbsoal.SaveFile strFileName, rtfText
    End If
    lblLabel2 = strFileName
    Exit Sub
    
ErrorHandler:
    MsgBox "Couldn't Open the File"
CancelHandler:

End Sub

Private Sub Command1_Click()

End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    Call tampil_soal
    Call tampil_jurusan
    Call tampil_tipe
    
    kunciteks
    kuncitombol
    cmtambah.Enabled = True
    
End Sub
Sub tampil_bidang()
    cbbidang.Clear
    perintah = "SELECT * FROM bid_studi WHERE kd_jurusan='" & kdjurusan & "' ORDER BY kd_bidang"
    Set bidang = konekdb.Execute(perintah)
    With bidang
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            cbbidang.AddItem !nm_bidang
            .MoveNext
            Loop
        End If
    End With
    
End Sub
Sub tampil_jurusan()
    cbjurusan.Clear
    perintah = "SELECT * FROM jurusan ORDER BY kd_jurusan"
    Set jurusan = konekdb.Execute(perintah)
    With jurusan
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            cbjurusan.AddItem !nm_jurusan
            jurusan.MoveNext
            Loop
        End If
    End With
End Sub

Sub tampil_tipe()
    cbtipe.Clear
    perintah = "SELECT * FROM tipe_soal ORDER BY kd_tipe"
    Set tipe = konekdb.Execute(perintah)
    With tipe
        If .EOF And .BOF Then
            Exit Sub
        Else
            Do Until .EOF
            cbtipe.AddItem !nm_tipe
            .MoveNext
            Loop
        End If
    End With
End Sub
Sub bersih()
    txtkode.Text = ""
    rbsoal.Text = ""
    cbjurusan.Text = ""
    cbbidang.Text = ""
    cbtipe.Text = ""
    txtfile.Text = ""
    txtgambar.Text = ""
    cbjawaban.Text = ""
    
End Sub

Sub kuncitombol()
    cmtambah.Enabled = True
    cmsimpan.Enabled = False
    cmedit.Enabled = False
    cmhapus.Enabled = False
End Sub

Sub bukatombol()
    cmtambah.Enabled = True
    cmsimpan.Enabled = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
End Sub

Sub kunciteks()
    txtkode.Locked = True
    rbsoal.Locked = True
End Sub

Sub bukateks()
    txtkode.Locked = False
    rbsoal.Locked = False
End Sub
Sub tampil_soal()

Dim item As MSComctlLib.ListItem
Dim No As Integer

perintah = "select J.*,T.*,S.*,B.* from jurusan J,tipe_soal T,soal S,bid_studi B" _
            & " WHERE S.kd_jurusan=J.kd_jurusan AND S.kd_bidang=B.kd_bidang AND S.kd_tipe=T.kd_tipe Order by B.nm_bidang"
Set soal = konekdb.Execute(perintah)

lssoal.ListItems.Clear
With lssoal
    .ColumnHeaders.Clear
    .View = lvwReport
    .FullRowSelect = True
    .GridLines = True
    .LabelEdit = lvwManual
    .ColumnHeaders.Add , , "No", 30
    .ColumnHeaders.Add , , "Kode", 35
    .ColumnHeaders.Add , , "Nama soal", 100
    .ColumnHeaders.Add , , "Jurusan", 100
    .ColumnHeaders.Add , , "Bidang Studi", 100
    .ColumnHeaders.Add , , "tipe", 70
    .ColumnHeaders.Add , , "Jawaban", 50
    .ColumnHeaders.Add , , "gambar", 50
    
End With

Do While Not soal.EOF
    No = No + 1
    Set item = lssoal.ListItems.Add(, , No)
    item.ListSubItems.Add , , soal!kd_soal
    item.ListSubItems.Add , , soal!soal
    item.ListSubItems.Add , , soal!nm_jurusan
    item.ListSubItems.Add , , soal!nm_bidang
    item.ListSubItems.Add , , soal!nm_tipe
    item.ListSubItems.Add , , soal!jawaban
    item.ListSubItems.Add , , soal!gambar
    soal.MoveNext
    
Loop

End Sub
Sub tambah()

Dim nomor As String
     perintah = "SELECT * FROM soal ORDER BY kd_soal"
     Set soal = konekdb.Execute(perintah)
    With soal
    
        If .RecordCount = 0 Then
            txtkode.Text = "S001"
        Else
            .MoveLast
            nomor = !kd_soal
            nomor = Right(nomor, 3)
            nomor = Val(nomor) + 1001
            nomor = Str(nomor)
            nomor = Right(nomor, 3)
            
            txtkode.Text = "S" + nomor
                    
        End If
    End With
End Sub

Private Sub lssoal_Click()
   Dim gambar As String
    If lssoal.ListItems.Count = 0 Then
        MsgBox "data masih kosong!", vbInformation, "informasi"
    Else
        txtkode.Text = lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(1)
        cbjurusan.Text = lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(3)
        cbbidang.Text = lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(4)
        rbsoal.LoadFile App.Path & "\soal\" & cbjurusan & "\" & cbbidang & "\" & lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(2)
        
        cbtipe.Text = lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(5)
        cbjawaban.Text = lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(6)
        txtfile.Text = App.Path & "\soal\" & cbjurusan & "\" & cbbidang & "\" & lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(2)
        
        gambar = lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(7)
        If gambar = "" Then
            imgsoal.Visible = False
            txtgambar.Text = ""
        Else
            imgsoal.Visible = True
            imgsoal.Picture = LoadPicture(App.Path & "\soal\" & cbjurusan & "\" & cbbidang & "\" & gambar)
            txtgambar.Text = App.Path & "\soal\" & cbjurusan & "\" & cbbidang & "\" & lssoal.ListItems(lssoal.SelectedItem.Index).SubItems(7)
        End If

    End If
    
    Call kuncitombol
    Call bukateks
    txtkode.Locked = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
    
End Sub

•	Form Ftipe
Private Sub cmedit_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txttipe.Text = "" Then
        MsgBox "tipe penyakit kosong", vbInformation, "informasi"
        txttipe.SetFocus
    Else
        perintah = "UPDATE tipe_soal SET nm_tipe='" & txttipe & "',keterangan='" & txtketerangan & "' WHERE kd_tipe='" & txtkode & "'"
        Set tipe = konekdb.Execute(perintah)
        MsgBox "Data sudah diubah!!", vbInformation, "informasi"
        Call Form_Load
        
    End If

End Sub

Private Sub cmhapus_Click()
    
        If MsgBox("Anda yakin akan menghapus kode " & txtkode & " ??", vbYesNo, "informasi") = vbYes Then
            perintah = "DELETE FROM tipe_soal WHERE kd_tipe='" & txtkode & "'"
            Set tipe = konekdb.Execute(perintah)
            MsgBox "data sudah terhapus", vbInformation, "informasi"
            bersih
            Call Form_Load
        End If

    
End Sub

Private Sub cmkeluar_Click()
    tipe.Close
    Unload Me
End Sub

Private Sub cmsimpan_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txttipe.Text = "" Then
        MsgBox "tipe penyakit kosong", vbInformation, "informasi"
        txttipe.SetFocus
    Else
        perintah = "INSERT INTO tipe_soal (kd_tipe,nm_tipe,keterangan) VALUES ('" & txtkode & _
                    "','" & txttipe & "','" & txtketerangan & "')"
        Set tipe = konekdb.Execute(perintah)
        MsgBox "data sudah tersimpan", vbInformation, "informasi"
        Call Form_Load
        bersih
    End If
End Sub

Private Sub cmtambah_Click()
    Call tambah
    bukateks
    bukatombol
    cmtambah.Enabled = False
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    Call tampil_tipe
    kunciteks
    kuncitombol
    cmtambah.Enabled = True

End Sub

Sub bersih()
    txtkode.Text = ""
    txttipe.Text = ""
    
End Sub

Sub kuncitombol()
    cmtambah.Enabled = False
    cmsimpan.Enabled = False
    cmedit.Enabled = False
    cmhapus.Enabled = False
End Sub

Sub bukatombol()
    cmtambah.Enabled = True
    cmsimpan.Enabled = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
End Sub

Sub kunciteks()
    txtkode.Locked = True
    txttipe.Locked = True
End Sub

Sub bukateks()
    txtkode.Locked = False
    txttipe.Locked = False
End Sub
Sub tampil_tipe()

Dim item As MSComctlLib.ListItem
Dim No As Integer

perintah = "select * from tipe_soal Order by kd_tipe"
Set tipe = konekdb.Execute(perintah)

lstipe.ListItems.Clear
With lstipe
    .ColumnHeaders.Clear
    .View = lvwReport
    .FullRowSelect = True
    .GridLines = True
    .LabelEdit = lvwManual
    .ColumnHeaders.Add , , "No", 30
    .ColumnHeaders.Add , , "Kode", 50
    .ColumnHeaders.Add , , "Nama tipe", 260
    .ColumnHeaders.Add , , "Keterangan", 300

End With

Do While Not tipe.EOF
    No = No + 1
    Set item = lstipe.ListItems.Add(, , No)
    item.ListSubItems.Add , , tipe!kd_tipe
    item.ListSubItems.Add , , tipe!nm_tipe
    item.ListSubItems.Add , , tipe!keterangan
    tipe.MoveNext
    
Loop

End Sub
Sub tambah()

Dim nomor As String
     
    With tipe
        If .RecordCount = 0 Then
            txtkode.Text = "T001"
        Else
            .MoveLast
            nomor = !kd_tipe
            nomor = Right(nomor, 3)
            nomor = Val(nomor) + 1001
            nomor = Str(nomor)
            nomor = Right(nomor, 3)
            
            txtkode.Text = "T" + nomor
                    
        End If
    End With
End Sub

Private Sub lstipe_Click()
    If lstipe.ListItems.Count = 0 Then
        MsgBox "data masih kosong!", vbInformation, "informasi"
    Else
        txtkode.Text = lstipe.ListItems(lstipe.SelectedItem.Index).SubItems(1)
        txttipe.Text = lstipe.ListItems(lstipe.SelectedItem.Index).SubItems(2)
        txtketerangan.Text = lstipe.ListItems(lstipe.SelectedItem.Index).SubItems(3)
    End If
    
    Call kuncitombol
    Call bukateks
    txtkode.Locked = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
    
End Sub

•	Form Funiversitas
Private Sub cmedit_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txtuniversitas.Text = "" Then
        MsgBox "universitas penyakit kosong", vbInformation, "informasi"
        txtuniversitas.SetFocus
    Else
        perintah = "UPDATE universitas SET nm_universitas='" & txtuniversitas & "' WHERE kd_universitas='" & txtkode & "'"
        Set universitas = konekdb.Execute(perintah)
        MsgBox "Data sudah diubah!!", vbInformation, "informasi"
        Call Form_Load
        
    End If

End Sub

Private Sub cmhapus_Click()
    
        If MsgBox("Anda yakin akan menghapus kode " & txtkode & " ??", vbYesNo, "informasi") = vbYes Then
            perintah = "DELETE FROM universitas WHERE kd_universitas='" & txtkode & "'"
            Set universitas = konekdb.Execute(perintah)
            MsgBox "data sudah terhapus", vbInformation, "informasi"
            bersih
            Call Form_Load
        End If

    
End Sub

Private Sub cmkeluar_Click()
    universitas.Close
    Unload Me
End Sub

Private Sub cmsimpan_Click()
    If txtkode.Text = "" Then
        MsgBox "kode masih kosong", vbInformation, "informasi"
        txtkode.SetFocus
    ElseIf txtuniversitas.Text = "" Then
        MsgBox "universitas penyakit kosong", vbInformation, "informasi"
        txtuniversitas.SetFocus
    Else
        perintah = "INSERT INTO universitas (kd_universitas,nm_universitas) VALUES ('" & txtkode & _
                    "','" & txtuniversitas & "')"
        Set universitas = konekdb.Execute(perintah)
        MsgBox "data sudah tersimpan", vbInformation, "informasi"
        Call Form_Load
        bersih
    End If
End Sub

Private Sub cmtambah_Click()
    Call tambah
    bukateks
    bukatombol
    cmtambah.Enabled = False
End Sub

Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\skin\media.skn"
 Skin1.ApplySkin hWnd
    Call dbumptn.buka
    Call tampil_universitas
    kunciteks
    kuncitombol
    cmtambah.Enabled = True

End Sub

Sub bersih()
    txtkode.Text = ""
    txtuniversitas.Text = ""
    
End Sub

Sub kuncitombol()
    cmtambah.Enabled = False
    cmsimpan.Enabled = False
    cmedit.Enabled = False
    cmhapus.Enabled = False
End Sub

Sub bukatombol()
    cmtambah.Enabled = True
    cmsimpan.Enabled = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
End Sub

Sub kunciteks()
    txtkode.Locked = True
    txtuniversitas.Locked = True
End Sub

Sub bukateks()
    txtkode.Locked = False
    txtuniversitas.Locked = False
End Sub
Sub tampil_universitas()

Dim item As MSComctlLib.ListItem
Dim No As Integer

perintah = "select * from universitas Order by kd_universitas"
Set universitas = konekdb.Execute(perintah)

lsuniversitas.ListItems.Clear
With lsuniversitas
    .ColumnHeaders.Clear
    .View = lvwReport
    .FullRowSelect = True
    .GridLines = True
    .LabelEdit = lvwManual
    .ColumnHeaders.Add , , "No", 30
    .ColumnHeaders.Add , , "Kode", 50
    .ColumnHeaders.Add , , "Nama universitas", 260

End With

Do While Not universitas.EOF
    No = No + 1
    Set item = lsuniversitas.ListItems.Add(, , No)
    item.ListSubItems.Add , , universitas!kd_universitas
    item.ListSubItems.Add , , universitas!nm_universitas
    universitas.MoveNext
    
Loop

End Sub
Sub tambah()

Dim nomor As String
     
    With universitas
        If .RecordCount = 0 Then
            txtkode.Text = "UV001"
        Else
            .MoveLast
            nomor = !kd_universitas
            nomor = Right(nomor, 3)
            nomor = Val(nomor) + 1001
            nomor = Str(nomor)
            nomor = Right(nomor, 3)
            
            txtkode.Text = "UV" + nomor
                    
        End If
    End With
End Sub

Private Sub lsuniversitas_Click()
    If lsuniversitas.ListItems.Count = 0 Then
        MsgBox "data masih kosong!", vbInformation, "informasi"
    Else
        txtkode.Text = lsuniversitas.ListItems(lsuniversitas.SelectedItem.Index).SubItems(1)
        txtuniversitas.Text = lsuniversitas.ListItems(lsuniversitas.SelectedItem.Index).SubItems(2)
    End If
    
    Call kuncitombol
    Call bukateks
    txtkode.Locked = True
    cmedit.Enabled = True
    cmhapus.Enabled = True
    
End Sub

•	Module dbumptn
Option Explicit
Public konekdb  As ADODB.Connection
Public universitas As ADODB.Recordset
Public prodi As ADODB.Recordset
Public pilihfak As ADODB.Recordset
Public hasil As ADODB.Recordset
Public peserta As ADODB.Recordset
Public jurusan As ADODB.Recordset
Public soal As ADODB.Recordset
Public bidang As ADODB.Recordset
Public kelompok As ADODB.Recordset
Public jawaban As ADODB.Recordset
Public tipe As ADODB.Recordset
Public bank As ADODB.Recordset
Public admin As ADODB.Recordset
Public bantu, bantu1, bantu2 As ADODB.Recordset

Public perintah, perintah1, perintah2, kode As String
Public nomor As String

Sub buka()
Set konekdb = New ADODB.Connection
'koneksi mysql
konekdb.CursorLocation = adUseClient

konekdb.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" & _
                        "SERVER=localhost;" & _
                        "DATABASE=umptn;" & _
                        "UID=;" & _
                        "PASSWORD=;" & _
                        "PORT=3306;OPTION=;STMT=;"
'koneksi acces

konekdb.Open
Set universitas = New ADODB.Recordset
Set prodi = New ADODB.Recordset
Set pilihfak = New ADODB.Recordset
Set hasil = New ADODB.Recordset
Set peserta = New ADODB.Recordset
Set kelompok = New ADODB.Recordset
Set bidang = New ADODB.Recordset
Set jurusan = New ADODB.Recordset
Set soal = New ADODB.Recordset
Set bantu = New ADODB.Recordset
Set bantu1 = New ADODB.Recordset
Set bantu2 = New ADODB.Recordset
Set jawaban = New ADODB.Recordset
Set tipe = New ADODB.Recordset
Set bank = New ADODB.Recordset
Set admin = New ADODB.Recordset
End Sub

'Private Sub Main()
  
  'FSplash.Show
  'Load FMenuUtama
  
 ' Do
   ' DoEvents
 ' Loop Until FSplash.ReadyToClose
  
  'FMenuUtama.Show
  'Unload FSplash
 ' Set FSplash = Nothing

'End Sub

•	Module modLaporan

Sub lappeserta()
    perintah = "SELECT no_peserta,nama,tgl_lahir,kd_jurusan,nm_sklh FROM Peserta ORDER BY no_peserta "
    Set peserta = konekdb.Execute(perintah)
    'cek data kosong
    If peserta.BOF Then
        MsgBox "tidak ada data peserta", vbInformation, "informasi"
    Else
    'menciptakan laporan peserta
    With FLapPeserta
        Set .DataSource = Nothing
            .DataMember = ""
        Set .DataSource = peserta.DataSource
            With .Sections("Section1").Controls
                For i = 1 To .Count
                    
                  If TypeOf .item(i) Is RptTextBox Then
                        .item(i).DataMember = ""
                        .item(i).DataField = peserta.Fields(i - 1).Name
                    End If
                Next i
            End With
            .Show 1
    End With
    
    End If
    
End Sub
Sub lapunivprodi()
    'tampil universitas
    perintah = "SELECT nm_universitas FROM universitas WHERE kd_universitas='" & Flaporanuniv.kduniversitas & "'"
    Set universitas = konekdb.Execute(perintah)
    
    perintah = "SELECT P.kd_prodi,P.nm_prodi,P.grade,P.kuota FROM prodi P " _
                & " WHERE P.kd_universitas='" & Flaporanuniv.kduniversitas & "'" _
                & " ORDER BY P.kd_prodi"
    Set prodi = konekdb.Execute(perintah)
    'cek data kosong
    If prodi.BOF Then
        MsgBox "tidak ada data prodi", vbInformation, "informasi"
    Else
    'menciptakan laporan peserta
    With Flapperuniv
        .Sections("Section4").Controls("lbluniv").Caption = universitas!nm_universitas
        Set .DataSource = Nothing
            .DataMember = ""
        Set .DataSource = prodi.DataSource
            With .Sections("Section1").Controls
                For i = 1 To .Count
                    
                  If TypeOf .item(i) Is RptTextBox Then
                        .item(i).DataMember = ""
                        .item(i).DataField = prodi.Fields(i - 1).Name
                    End If
                Next i
            End With
            .Show 1
    End With
    
    End If
End Sub
Sub lappesertapertahun()

    perintah = "SELECT no_peserta,nama,nm_sklh,almt_sklh FROM Peserta WHERE no_peserta LIKE '" & Right(Flappertahun.cbtahun, 2) & "%' ORDER BY no_peserta "
    Set peserta = konekdb.Execute(perintah)
    'cek data kosong
    If peserta.BOF Then
        MsgBox "tidak ada data peserta", vbInformation, "informasi"
    Else
    'menciptakan laporan peserta
    With FLapPesertaTahun
        .Sections("Section4").Controls("lbltahun").Caption = Flappertahun.cbtahun
        Set .DataSource = Nothing
            .DataMember = ""
        Set .DataSource = peserta.DataSource
            With .Sections("Section1").Controls
                For i = 1 To .Count
                    
                  If TypeOf .item(i) Is RptTextBox Then
                        .item(i).DataMember = ""
                        .item(i).DataField = peserta.Fields(i - 1).Name
                    End If
                Next i
            End With
            .Show 1
    End With
    
    End If
    
End Sub
Sub laphasilprodi()
    If FlapPilihan.cbpilihan = "berhasil" Then
        perintah = "SELECT peserta.no_peserta,peserta.nama,universitas.nm_universitas,prodi.nm_prodi FROM peserta,prodi,universitas,hasil " _
                    & " WHERE peserta.no_peserta=hasil.no_peserta AND " _
                    & " hasil.kd_prodi=prodi.kd_prodi AND prodi.kd_universitas=universitas.kd_universitas AND " _
                    & " hasil.status='" & FlapPilihan.cbpilihan & "' AND peserta.no_peserta LIKE '" & Right(FlapPilihan.cbtahun, 2) & "%' "
         Set hasil = konekdb.Execute(perintah)
        'cek data kosong
    If hasil.BOF Then
        MsgBox "tidak ada data hasil peserta", vbInformation, "informasi"
    Else
    'menciptakan laporan peserta
    With Flaphasilprodi
    
        .Sections("Section4").Controls("lbljudul").Caption = "DAFTAR PESERTA YANG BERHASIL"
        Set .DataSource = Nothing
            .DataMember = ""
        Set .DataSource = hasil.DataSource
            With .Sections("Section1").Controls
                For i = 1 To .Count
                    
                  If TypeOf .item(i) Is RptTextBox Then
                        .item(i).DataMember = ""
                        .item(i).DataField = hasil.Fields(i - 1).Name
                    End If
                Next i
            End With
            .Show 1
    End With
    
    End If
    ElseIf FlapPilihan.cbpilihan = "Tidak Berhasil" Then
        perintah = "SELECT peserta.no_peserta,peserta.nama,hasil.kd_prodi,hasil.kd_prodi FROM peserta ,hasil " _
                    & " WHERE peserta.no_peserta=hasil.no_peserta AND " _
                    & " hasil.status='" & FlapPilihan.cbpilihan & "' AND peserta.no_peserta LIKE '" & Right(FlapPilihan.cbtahun, 2) & "%' "
        Set hasil = konekdb.Execute(perintah)
        'cek data kosong
    If hasil.BOF Then
        MsgBox "tidak ada data hasil peserta", vbInformation, "informasi"
    Else
    'menciptakan laporan peserta
    With Flaphasilprodi
        .Sections("Section4").Controls("lbljudul").Caption = "DAFTAR PESERTA YANG TIDAK BERHASIL"
        Set .DataSource = Nothing
            .DataMember = ""
        Set .DataSource = hasil.DataSource
            With .Sections("Section1").Controls
                For i = 1 To .Count
                    
                  If TypeOf .item(i) Is RptTextBox Then
                        .item(i).DataMember = ""
                        .item(i).DataField = hasil.Fields(i - 1).Name
                    End If
                Next i
            End With
            .Show 1
    End With
    End If
    
    End If
End Sub