LAMPIRAN : LISTING PROGRAM

Similar documents
LAMPIRAN LIST PROGRAM

Tutorial, Source code, Request Program Visual Basic

LISTING PROGRAM. 1. Form Menu Utama. Universitas Sumatera Utara

LAMPIRAN A LISTING PROGRAM. Universitas Sumatera Utara

End Sub. Sub Kunci() Dim i As Integer For i = 0 To 4 Txtfield(i).Locked = True Next i grddatagrid.enabled = False End Sub

LAMPIRAN. Universitas Sumatera Utara

LAMPIRAN A : LISTING PROGRAM

LISTING PROGRAM. 1. Form Login. Private Sub BATAL_Click() End End Sub

LISTING PROGRAM. Form Splash

LISTING PROGRAM. 1. Menu Utama

LAMPIRAN. Universitas Sumatera Utara

LAMPIRAN 1. Kode Program Splash Screen

L A M P I R A N. Universitas Sumatera Utara

LAMPIRAN FORM 1 Universitas Sumatera Universitas Utara

LAMPIRAN A : LISTING PROGRAM

An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is

Nilai Input (Peringkat Alternatif Fuzzy dan Crisp Terhadap Kriteria)

1. Menu Utama. Private Sub abt_click() frmabout.show End Sub. Private Sub dafabsenhar_click() frmdafabsensihar.show End Sub

LAMPIRAN. Universitas Sumatera Utara

LISTING PROGRAM. 1. Menu Utama

Understanding the MsgBox command in Visual Basic

LISTING PROGRAM. PrivateSub KeluarToolStripMenuItem_Click(sender AsObject, e AsEventArgs) Handles KeluarToolStripMenuItem.Click Close() EndSub

Lookup Project. frmlookup (Name: object is a combo box, style 2); use 4 labels: 2 for phone, 2 for mail. MsgBox Function:

LAMPIRAN A: Listing Program

LISTING PROGRAM. Source Code Tampilan Awal. Source Code Menu Utama

Visitor Management System

LAMPIRAN A PROGRAM ADMINISTRASI

KARTU BIMBINGAN TUGAS AKHIR MAHASISWA PEMBAHASAN PADA ASISTENSI MENGENAI, PADA BAB

SURAT KETERANGAN Hasil Uji Program Tugas Akhir

Pengenalan Sistem Maklumat Dalam Pendidikan

PANDUAN PENGGUNA (PENTADBIR SYSTEM/SYSTEM ADMINISTRATOR) (INFOTECH, BPPF DAN POLIS

REGISTRATION GUIDE MCIS CUSTOMER PORTAL. Page 1

Manual Pengguna. PCN Online Service Fulfillment System

Excel & Visual Basic for Applications (VBA)

PANDUAN PENGGUNA (SUPPLIER) MAINTAIN CERTIFICATES/SUPPLIER DETAILS SUPPLIER RELATIONSHIP MANAGEMENT SUPPLY CHAIN MANAGEMENT SYSTEM (SCMS)

Rooftop Industries Pvt. Ltd.

On Railway Reservation. U G D C A Semester VI. Roll No DA

PANDUAN PENGGUNA (SUPPLIER) MAINTAIN CERTIFICATES/SUPPLIER DETAILS SUPPLIER RELATIONSHIP MANAGEMENT SUPPLY CHAIN MANAGEMENT SYSTEM (SCMS)

Universitas Sumatera Utara

PANDUAN PENGGUNA (PENSYARAH)

6/14/2010. VBA program units: Subroutines and Functions. Functions: Examples: Examples:

TABLE OF CONTENTS ADVANCED VISUAL BASIC

DOKUMEN TIDAK TERKAWAL

COMBINING TABLES. Akademi Audit Negara. CAATs ASAS ACL / 1

Programming Concepts and Skills. Arrays continued and Functions

M2U MANUAL PENGGUNA USER MANUAL M2UNHJ. 0 P a g e BAHAGIAN SIMPANAN DAN PENGELUARAN JABATAN KHIDMAT PENDEPOSIT DAN OPERASI LEMBAGA TABUNG HAJI

A Back-End Link Checker for Your Access Database

ต วอย างการสร างฟอร ม เมน การใช งาน

variables programming statements

IFA/QFN VBA Tutorial Notes prepared by Keith Wong

LAMPIRAN A PROGRAM FLOWSTONE

EMPLOYEE PAYROLL SYSTEM

MICROSOFT EXCEL. Membina Hamparan Elektronik Fungsi Hamparan Elektronik

Visual Programming 1. What is Visual Basic? 2. What are different Editions available in VB? 3. List the various features of VB

22. VB Programming Fundamentals Data Access with Data Objects

Cara Login Ke CPanel Hosting.

MANAGE COURSE RESOURCES LABEL TEXT PAGE URL BOOK FILE FOLDER IMS CONTENT PACKAGE

LAMPIRAN. Universitas Sumatera Utara

Pengguna akan diberikan Username dan Password oleh Administrator untuk login sebagai admin/conference Manager bagi conference yang akan diadakan.

L A M P I R A N. Universitas Sumatera Utara

Definition, Investigation and Analysis

ICT SPM 2011 SUGGESTION ANSWER. Section A

MgtOp 470 Business Modeling with Spreadsheets Sample Midterm Exam. 1. Spreadsheets are known as the of business analysis.

Private Sub Command2_Click() End End Sub. Private Sub Command3_Click() frmchangepassword.show End Sub. Private Sub Form_Activate() check_db End Sub


Registration of Supplier (ROS) TM Supplier Registration Renewal via SUS Portal (Pembaharuan Pendaftaran Pembekal TM melalui SUS Portal)

Programming with visual Basic:

Panduan Menggunakan Autoresponder FreeAutobot.com

LAMPIRAN Lampiran Utama. a. Struktur Organisasi

LAMPIRAN 1 PENGARUH KETERSEDIAAN KOLEKSI PERPUSTAKAAN TERHADAP MINAT BACA SISWA SMP NEGERI 30 MEDAN

L A M P I R A N. Universitas Sumatera Utara

Cara Install Windows 7 Service Pack 1 Offline

DETECTION OF WORMHOLE ATTACK IN MOBILE AD-HOC NETWORKS MOJTABA GHANAATPISHEH SANAEI

PART A SULIT (EKT 221) BAHAGIAN A. Answer ALL questions. Question 1. a) Briefly explain the concept of Clock Gating.

Revisions: jee Initial jee SW Version 1.1 now includes the leave type Other

LISTING PROGRAM. mainform.vb A-1. Universitas Sumatera Utara

Lampiran A : Listing Program

How-To Guide. SigIDp (With Microsoft Access) Demo. Copyright Topaz Systems Inc. All rights reserved.

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

Creating Macros David Giusto, Technical Services Specialist, Synergy Resources

Please answer questions in the space provided. Question point values are shown in parentheses.

PANDUAN PENGGUNA (SUPPLIER) e-purchase ORDER FOR SERVICES

UNIVERSITI SAINS MALAYSIA. CST232 Operating Systems [Sistem Pengendalian]

AN IMPROVED PACKET FORWARDING APPROACH FOR SOURCE LOCATION PRIVACY IN WIRELESS SENSORS NETWORK MOHAMMAD ALI NASSIRI ABRISHAMCHI

PROGRAM BASCOM AVR. ' inisialisasi '

TEKNOLOGI, GADJET & KEIBUBAPAAN

CREATING USER ID AND PASSWORD : NOTA PENTING NOTA PENTING SEBELUM MEMULAKAN PROSES CREATE USER ID & PASSWORD

Semasa buku ini ditulis XAMPP mengandungi empat versi:

Visual Basic , ,. Caption Hello, On Off. * + +, -. 1-Arrow, , 2- Cross. - project1.vbp, 4-form1.frm.

UNIVERSITI SAINS MALAYSIA

SEMANTICS ORIENTED APPROACH FOR IMAGE RETRIEVAL IN LOW COMPLEX SCENES WANG HUI HUI

Visual Basic ,

1. Threats bermaksud ancaman, atau lebih dikenali sebagai malware (malicious

<td style="text-align:center;">'.$no.'</td> <a href="'.$link_update.'&id='.$h['id_diagnosa'].'&action=edit" class="btn btn-xs btn-default">edit</a>

LAMPIRAN A. Universitas Sumatera Utara

Cara Instal Driver Printer Hp Deskjet 1010 Di Windows Xp

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

Information Security Management System ISO/IEC 27001:2013

ENHANCING TIME-STAMPING TECHNIQUE BY IMPLEMENTING MEDIA ACCESS CONTROL ADDRESS PACU PUTRA SUARLI

Lab Sheet 4.doc. Visual Basic. Lab Sheet 4: Non Object-Oriented Programming Practice

Transcription:

LAMPIRAN : LISTING PROGRAM Kode Program Form Login Private Sub cbolevel_click() If cbolevel.text = "Pengguna" Then txtlogin.enabled = False txtpass.enabled = False txtlogin.visible = False txtpass.visible = False SkinLabel2.Visible = False SkinLabel3.Visible = False If cbolevel.text = "Pakar" Then txtlogin.enabled = True txtpass.enabled = True txtlogin.text = "" txtpass.text = "" txtlogin.setfocus If cbolevel.text = "Administrator" Then txtlogin.enabled = True txtpass.enabled = True txtlogin.text = "" txtpass.text = "" txtlogin.setfocus cmdmasuk.enabled = True Private Sub cmdkeluar_click() Unload Me Private Sub cmdmasuk_click() On Error GoTo login_err If cbolevel.text = "Pengguna" Then userid = "Pengguna" levelid = "Pengguna" frmutama.show Unload Me If txtlogin.text = "" Then MsgBox "Masukkan User ID!", vbcritical txtlogin.setfocus If Not validity(txtlogin, "User ID") Then txtlogin.setfocus If txtpass.text = "" Then MsgBox "Masukkan Password!", vbcritical txtpass.setfocus

If Not validity(txtpass, "Password") Then txtpass.setfocus konek_db Dim sql As String Set adors = New ADODB.Recordset sql = "select * from list_user where user_id = '" & txtlogin.text_ & "' and pass = '" & Crypt(txtPass.Text) & "'" adors.open sql, Conn, adopendynamic, adlockoptimistic If (adors.eof) Then MsgBox "User ID dan Password salah! Coba Lagi!", vbcritical, txtlogin.text = "" txtpass.text = "" txtlogin.setfocus Call closeconn levelid = adors!level Call closeconn userid = txtlogin.text Unload Me frmutama.show login_err: MsgBox Err.Description Private Sub Label6_Click() frmuserbaru.show vbmodal Private Sub Label7_Click() frmgantipass.show vbmodal Private Sub Label9_Click() frmhapususer.show vbmodal Private Sub Form_Load() Skin1.LoadSkin App.Path & "\SKIN\green.skn" Skin1.ApplySkin hwnd cbolevel.additem "Pengguna" cbolevel.additem "Pakar" cbolevel.additem "Administrator" cmdmasuk.enabled = False Private Sub Timer1_Timer() Label6.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)

Kode Program Form Utama Private Sub cmddiagnosis_click() frmpilihpenyakit.show vbmodal Private Sub cmdpengetahuan_click() frmpengetahuan.show vbmodal Private Sub Form_Activate() Call Form_Load Private Sub Form_Load() Skin1.LoadSkin App.Path & "\SKIN\green.skn" Skin1.ApplySkin hwnd konek_db StatusBar1.Panels(1) = userid StatusBar1.Panels(2) = levelid If levelid = "Pengguna" Then cmdpengetahuan.visible = False mnbasis.visible = False cmdpengetahuan.visible = True mnbasis.visible = True Private Sub Form_Unload(Cancel As Integer) diskonek_db Unload Me End Private Sub mndiagnosispenyakit_click() frmpilihpenyakit.show vbmodal Private Sub mnedit_click() frmpengetahuan.show vbmodal Private Sub mnkeluar_click() Dim pesan pesan = MsgBox("Anda yakin mau keluar dari program?", vbquestion + vbyesno + vbdefaultbutton2, "Konfirmasi") If pesan = vbyes Then Unload Me Private Sub mnlogoff_click() Dim pesan pesan = MsgBox("Anda yakin mau Log-Off dari sistem?", vbquestion + vbyesno + vbdefaultbutton2, "Konfirmasi") If pesan = vbyes Then frmlogin.show Me.Hide

Private Sub mnpembuat_click() frmpembuat.show vbmodal Private Sub mnprogram_click() frmprogram.show vbmodal Kode Program Form Diagnosis Private Sub cmdselesai_click() Me.Hide Private Sub cmdya_click() On Error Resume Next rstemp.addnew rstemp!id_temp = rsknowledge!id rstemp!fakta = rsknowledge!faktaya rstemp.update jwb = rsknowledge!ya If Left(jwb, 1) = "T" Then rsknowledge.movefirst rsknowledge.find " ID= '" & jwb & "' " rssolusi.movefirst rssolusi.find " ID_solusi= '" & jwb & "' " frmhasildiagnosis.label1.caption = rssolusi!solusi frmhasildiagnosis.image1.picture = LoadPicture(App.Path & "\xfoto\" & rssolusi!foto) frmhasildiagnosis.label2.caption = rssolusi!diagnosis frmhasildiagnosis.show vbmodal Private Sub cmdtidak_click() On Error Resume Next rstemp.addnew rstemp!id_temp = rsknowledge!id rstemp!fakta = rsknowledge!faktatidak rstemp.update jwb = rsknowledge!tidak If Left(jwb, 1) = "T" Then rsknowledge.movefirst rsknowledge.find " ID= '" & jwb & "' " rssolusi.movefirst rssolusi.find " ID_solusi= '" & jwb & "' " frmhasildiagnosis.label1.caption = rssolusi!solusi frmhasildiagnosis.image1.picture = LoadPicture(App.Path & "\xfoto\" & rssolusi!foto) frmhasildiagnosis.label2.caption = rssolusi!diagnosis frmhasildiagnosis.show vbmodal

Private Sub Form_Activate() Call Form_Load Private Sub Form_Load() Skin1.LoadSkin App.Path & "\SKIN\green.skn" Skin1.ApplySkin hwnd rstemp.requery While Not rstemp.eof rstemp.delete rstemp.movenext Wend rsknowledge.movefirst Select Case frmpilihpenyakit.cbopenyakit.listindex Case 0 rsknowledge.find " ID='T1' " Case 1 rsknowledge.find " ID='T15' " Case 2 rsknowledge.find " ID='T8' " Case 3 rsknowledge.find " ID='T1' " Case 4 rsknowledge.find " ID='T22' " Case 5 rsknowledge.find " ID='T20' " Case 6 rsknowledge.find " ID='T22' " End Select Private Sub Form_Unload(Cancel As Integer) Call cmdselesai_click Kode Program Form Pengetahuan Public baru As Boolean Dim rsrusak As New ADODB.Recordset Private Sub cbocari_click() txtcari.text = "" txtcari.setfocus Private Sub cmdbatal_click() Adodc1.Recordset.Cancel

KosongkanForm Private Sub cmdhapus_click() On Error GoTo hapuserr Dim pil pil = MsgBox("Apakah anda yakin data ini akan dihapus?", vbquestion + vbyesno + vbdefaultbutton2, "Konfirmasi") If pil = vbyes Then Adodc1.Recordset.Delete Adodc1.Recordset.MoveLast MsgBox "Data Berhasil Dihapus!", vbinformation, "Informasi" hapuserr: Private Sub cmdinputpenyakit_click() frmpenyakit.show vbmodal Private Sub cmdinputsolusi_click() frmsolusi.show vbmodal Private Sub cmdkeluar_click() Me.Hide Private Sub cmdsimpan_click() On Error GoTo simpanerr If txtidknowledge.text = Empty Or _ cbopenyakit.text = "" Or _ txtpertanyaan.text = Empty Or _ txtfaktaya.text = Empty Or _ txtfaktatidak.text = Empty Or _ cboya.text = Empty Or _ cbotidak.text = Empty Then MsgBox "Informasi belum lengkap! Lengkapi terlebih dahulu!", vbexclamation, txtidknowledge.setfocus Dim rscek As ADODB.Recordset Set rscek = New ADODB.Recordset rscek.open "select * from knowledge where ID='" & txtidknowledge.text & "'", Conn If Not rscek.eof And baru Then MsgBox "Aturan dengan kode " & txtidknowledge.text & " sudah ada, silahkan ganti dengan kode yang lain!", vbexclamation, txtidknowledge.setfocus: SendKeys "{HOME}+{END}" With Adodc1.Recordset If baru Then.AddNew!ID = txtidknowledge.text

!ID_penyakit = txtidpenyakit.text!pertanyaan = txtpertanyaan.text!faktaya = txtfaktaya.text!faktatidak = txtfaktatidak.text!ya = cboya.text!tidak = cbotidak.text.update MsgBox "Data berhasil disimpan!", vbinformation, "Informasi" KosongkanForm End With simpanerr: Private Sub cmdtambah_click() baru = True KunciTeks False tombolawal False txtidknowledge.setfocus Sub tombolawal(kunci As Boolean) cmdtambah.enabled = kunci cmdsimpan.enabled = Not kunci cmdbatal.enabled = Not kunci cmdubah.enabled = kunci cmdhapus.enabled = kunci cmdkeluar.enabled = kunci Private Sub cmdubah_click() On Error GoTo ubaherr KunciTeks False tombolawal False With Adodc1.Recordset txtidknowledge.text =!ID txtidpenyakit.text =!ID_penyakit txtpertanyaan.text =!pertanyaan txtfaktaya.text =!faktaya txtfaktatidak.text =!faktatidak cboya.text =!Ya cbotidak.text =!Tidak Set rsrusak = New ADODB.Recordset rsrusak.open "select * from penyakit where ID_Penyakit='" & txtidpenyakit.text & "'", Conn cbopenyakit.text = rsrusak!jenis_penyakit End With

txtidknowledge.setfocus baru = False ubaherr: Private Sub Form_Activate() Dim i As Integer For i = 0 To 6 gridknowledge.columns(i).locked = True Next i For i = 0 To 1 gridpenyakit.columns(i).locked = True gridsolusi.columns(i).locked = True Next i cbocari.additem "ID Pengetahuan" cbocari.additem "Pertanyaan" cbocari.additem "ID Penyakit" 'If Not rspenyakit.eof Then cbopenyakit.clear rspenyakit.movefirst While Not rspenyakit.eof cbopenyakit.additem rspenyakit!jenis_penyakit rspenyakit.movenext Wend ' 'If Not rsknowledge.eof Then cboya.clear cbotidak.clear rsknowledge.movefirst While Not rsknowledge.eof cboya.additem rsknowledge!id cbotidak.additem rsknowledge!id rsknowledge.movenext Wend ' 'If Not rssolusi.eof Then rssolusi.movefirst While Not rssolusi.eof cboya.additem rssolusi!id_solusi cbotidak.additem rssolusi!id_solusi rssolusi.movenext Wend ' Private Sub Form_Load() Adodc1.ConnectionString = Conn.ConnectionString Adodc1.RecordSource = "select * from knowledge"

Adodc1.Refresh Set gridknowledge.datasource = Adodc1 Adodc3.ConnectionString = Conn.ConnectionString Adodc3.RecordSource = "select * from penyakit" Adodc3.Refresh Set gridpenyakit.datasource = Adodc3 Adodc2.ConnectionString = Conn.ConnectionString Adodc2.RecordSource = "select * from solusi" Adodc2.Refresh Set gridsolusi.datasource = Adodc2 gridpenyakit.columns(0).width = 400 gridpenyakit.columns(1).width = 5000 gridsolusi.columns(0).width = 400 gridsolusi.columns(1).width = 5000 gridknowledge.columns(0).width = 400 gridknowledge.columns(4).width = 400 gridknowledge.columns(5).width = 400 gridknowledge.columns(6).width = 400 Skin1.LoadSkin App.Path & "\SKIN\green.skn" Skin1.ApplySkin hwnd Sub KosongkanForm() txtidknowledge.text = Empty txtidpenyakit.text = Empty cbopenyakit.text = Empty txtpertanyaan.text = Empty txtfaktaya.text = Empty txtfaktatidak.text = Empty cboya.text = Empty cbotidak.text = Empty Sub KunciTeks(kunci As Boolean) txtidknowledge.locked = kunci cbopenyakit.locked = kunci txtpertanyaan.locked = kunci txtfaktaya.locked = kunci txtfaktatidak.locked = kunci cboya.locked = kunci cbotidak.locked = kunci Private Sub cbopenyakit_click() On Error GoTo rusakerr Set rsrusak = New ADODB.Recordset rsrusak.open "select * from penyakit where jenis_penyakit='" & cbopenyakit.text & "'", Conn txtidpenyakit.text = rsrusak!id_penyakit

rusakerr: Sub DaftarCari() On Error GoTo pesan Dim adofilter As New ADODB.Recordset Set adofilter = New ADODB.Recordset Dim sqlc As String adofilter.cursorlocation = aduseclient Select Case cbocari.text Case "ID Pengetahuan" sqlc = "SELECT * FROM knowledge where ID like " & "'%" & txtcari.text & "%'" & _ "ORDER BY ID" Case "Pertanyaan" sqlc = "SELECT * FROM knowledge where pertanyaan like " & "'%" & txtcari.text & "%'" & _ "ORDER BY ID" Case "ID Penyakit" sqlc = "SELECT * FROM knowledge where ID_Penyakit like " & "'%" & txtcari.text & "%'" & _ "ORDER BY ID" Case MsgBox "Pilih dulu mau mencari berdasarkan apa!", vbexclamation, 'txtcari.text = "" cbocari.setfocus End Select adofilter.open sqlc, Conn, adopendynamic, adlockoptimistic If Not adofilter.eof Then Set gridknowledge.datasource = adofilter Set Adodc1.Recordset = adofilter MsgBox "Maaf, data yang anda cari tidak terdapat pada database!", vbinformation, "Informasi" txtcari.text = "" pesan: Private Sub txtcari_change() DaftarCari

Kode Program Form Penyakit Public baru As Boolean Private Sub cmdbatal_click() Adodc1.Recordset.Cancel KosongkanForm Private Sub cmdhapus_click() On Error GoTo hapuserr Dim pil pil = MsgBox("Apakah anda yakin data ini akan dihapus?", vbquestion + vbyesno + vbdefaultbutton2, "Konfirmasi") If pil = vbyes Then Adodc1.Recordset.Delete Adodc1.Recordset.MoveLast MsgBox "Data Berhasil Dihapus!", vbinformation, "Informasi" hapuserr: Private Sub cmdkeluar_click() Me.Hide Private Sub cmdsimpan_click() On Error GoTo simpanerr If txtidpenyakit.text = Empty Or _ txtjenispenyakit.text = Empty Then MsgBox "Informasi belum lengkap! Lengkapi terlebih dahulu!", vbexclamation, txtidpenyakit.setfocus Dim rscek As ADODB.Recordset Set rscek = New ADODB.Recordset rscek.open "select * from penyakit where ID_penyakit='" & txtidpenyakit.text & "'", Conn If Not rscek.eof And baru Then MsgBox "Penyakit dengan kode " & txtidpenyakit.text & " sudah ada, silahkan ganti dengan kode yang lain!", vbexclamation, txtidpenyakit.setfocus: SendKeys "{HOME}+{END}" With Adodc1.Recordset If baru Then.AddNew!ID_penyakit = txtidpenyakit.text!jenis_penyakit = txtjenispenyakit.text.update

Adodc1.Refresh MsgBox "Data berhasil disimpan!", vbinformation, "Informasi" KosongkanForm End With simpanerr: Private Sub cmdtambah_click() baru = True KunciTeks False tombolawal False txtidpenyakit.setfocus Sub tombolawal(kunci As Boolean) cmdtambah.enabled = kunci cmdsimpan.enabled = Not kunci cmdbatal.enabled = Not kunci cmdubah.enabled = kunci cmdhapus.enabled = kunci cmdkeluar.enabled = kunci Private Sub cmdubah_click() On Error GoTo ubaherr KunciTeks False tombolawal False With Adodc1.Recordset txtidpenyakit.text =!ID_penyakit txtjenispenyakit.text =!jenis_penyakit End With txtidpenyakit.setfocus baru = False ubaherr: Private Sub Form_Activate() Dim i As Integer For i = 0 To 1 gridpenyakit.columns(i).locked = True Next i txtcari.text = ""

Private Sub Form_Load() Adodc1.ConnectionString = Conn.ConnectionString Adodc1.RecordSource = "select * from penyakit" Adodc1.Refresh Set gridpenyakit.datasource = Adodc1 gridpenyakit.columns(0).width = 400 gridpenyakit.columns(1).width = 5000 Skin1.LoadSkin App.Path & "\SKIN\green.skn" Skin1.ApplySkin hwnd Sub KosongkanForm() txtidpenyakit.text = Empty txtjenispenyakit.text = Empty Sub KunciTeks(kunci As Boolean) txtidpenyakit.locked = kunci txtjenispenyakit.locked = kunci Sub DaftarCari() On Error GoTo pesan Dim adofilter As New ADODB.Recordset Set adofilter = New ADODB.Recordset Dim sqlc As String adofilter.cursorlocation = aduseclient Select Case cbocari.text Case "ID Penyakit" sqlc = "SELECT * FROM penyakit where ID_penyakit like " & "'%" & txtcari.text & "%'" & _ "ORDER BY ID_penyakit" Case "Jenis penyakit" sqlc = "SELECT * FROM penyakit where jenis_penyakit like " & "'%" & txtcari.text & "%'" & _ "ORDER BY ID_penyakit" Case MsgBox "Pilih dulu mau mencari berdasarkan apa!", vbexclamation, cbocari.setfocus End Select adofilter.open sqlc, Conn, adopendynamic, adlockoptimistic If Not adofilter.eof Then Set gridpenyakit.datasource = adofilter Set Adodc1.Recordset = adofilter MsgBox "Maaf, data yang anda cari tidak terdapat pada database!", vbinformation, "Informasi" txtcari.text = ""

pesan: Private Sub cbocari_click() txtcari.text = "" txtcari.setfocus Private Sub txtcari_change() DaftarCari Kode Program Form Solusi Public baru As Boolean Private Sub cmdbatal_click() Adodc1.Recordset.Cancel KosongkanForm Private Sub cmdhapus_click() On Error GoTo hapuserr Dim pil pil = MsgBox("Apakah anda yakin data ini akan dihapus?", vbquestion + vbyesno + vbdefaultbutton2, "Konfirmasi") If pil = vbyes Then Adodc1.Recordset.Delete Adodc1.Recordset.MoveLast MsgBox "Data Berhasil Dihapus!", vbinformation, "Informasi" hapuserr: Private Sub cmdkeluar_click() Me.Hide Private Sub cmdsimpan_click() On Error GoTo simpanerr If txtidsolusi.text = Empty Or _ txtsolusi.text = Empty Then MsgBox "Informasi belum lengkap! Lengkapi terlebih dahulu!", vbexclamation, txtidsolusi.setfocus Dim rscek As ADODB.Recordset Set rscek = New ADODB.Recordset

rscek.open "select * from solusi where ID_solusi='" & txtidsolusi.text & "'", Conn If Not rscek.eof And baru Then MsgBox "Solusi dengan kode " & txtidsolusi.text & " sudah ada, silahkan ganti dengan kode yang lain!", vbexclamation, txtidsolusi.setfocus: SendKeys "{HOME}+{END}" With Adodc1.Recordset If baru Then.AddNew!ID_solusi = txtidsolusi.text!solusi = txtsolusi.text.update MsgBox "Data berhasil disimpan!", vbinformation, "Informasi" KosongkanForm End With simpanerr: Private Sub cmdtambah_click() baru = True KunciTeks False tombolawal False txtidsolusi.setfocus Sub tombolawal(kunci As Boolean) cmdtambah.enabled = kunci cmdsimpan.enabled = Not kunci cmdbatal.enabled = Not kunci cmdubah.enabled = kunci cmdhapus.enabled = kunci cmdkeluar.enabled = kunci Private Sub cmdubah_click() On Error GoTo ubaherr KunciTeks False tombolawal False With Adodc1.Recordset txtidsolusi.text =!ID_solusi txtsolusi.text =!solusi End With txtidsolusi.setfocus baru = False

ubaherr: Private Sub Form_Activate() Dim i As Integer For i = 0 To 1 gridsolusi.columns(i).locked = True Next i txtcari.text = "" Private Sub Form_Load() Adodc1.ConnectionString = Conn.ConnectionString Adodc1.RecordSource = "select * from solusi" Adodc1.Refresh Set gridsolusi.datasource = Adodc1 gridsolusi.columns(0).width = 400 gridsolusi.columns(1).width = 5000 Skin1.LoadSkin App.Path & "\SKIN\green.skn" Skin1.ApplySkin hwnd Sub KosongkanForm() txtidsolusi.text = Empty txtsolusi.text = Empty Sub KunciTeks(kunci As Boolean) txtidsolusi.locked = kunci txtsolusi.locked = kunci Sub DaftarCari() On Error GoTo pesan Dim adofilter As New ADODB.Recordset Set adofilter = New ADODB.Recordset Dim sqlc As String adofilter.cursorlocation = aduseclient Select Case cbocari.text Case "ID Solusi" sqlc = "SELECT * FROM solusi where ID_Solusi like " & "'%" & txtcari.text & "%'" & _ "ORDER BY ID_Solusi" Case "Solusi" sqlc = "SELECT * FROM solusi where solusi like " & "'%" & txtcari.text & "%'" & _ "ORDER BY ID_Solusi" Case MsgBox "Pilih dulu mau mencari berdasarkan apa!", vbexclamation, cbocari.setfocus End Select

adofilter.open sqlc, Conn, adopendynamic, adlockoptimistic If Not adofilter.eof Then Set gridsolusi.datasource = adofilter Set Adodc1.Recordset = adofilter MsgBox "Maaf, data yang anda cari tidak terdapat pada database!", vbinformation, "Informasi" txtcari.text = "" pesan: Private Sub cbocari_click() txtcari.text = "" txtcari.setfocus Private Sub txtcari_change() DaftarCari Kode Program Form Hasil Diagnosis Private Sub cmdalasan_click() frmpenanganan.label2.text = "" rstemp.movefirst While Not rstemp.eof frmpenanganan.label2.text = frmpenanganan.label2.text + _ rstemp!fakta + vbcrlf rstemp.movenext Wend frmpenanganan.label2.text = frmpenanganan.label2.text + vbcrlf + vbcrlf + _ "Maka Solusinya : " + vbcrlf + rssolusi!solusi frmpenanganan.show vbmodal Private Sub cmdselesai_click() Me.Hide frmdiagnosis.hide Private Sub Form_Unload(Cancel As Integer) Call cmdselesai_click Private Sub Form_Load() Skin1.LoadSkin App.Path & "\SKIN\green.skn" Skin1.ApplySkin hwnd