Anda di halaman 1dari 22

Buka localhost/phpmyadmin

BUKA VB
REPORT
Private Sub batal_Click()

kosong

tdk_isi

tambah.Enabled = True

hapus.Enabled = True

ubah.Enabled = True

simpan.Enabled = False

keluar.Enabled = True

batal.Enabled = True

End Sub

Private Sub cari_Click()

Adodc1.Recordset.Find "kode_poli='" + txtcari.Text + "'", , adSearchForward, 1

If Not Adodc1.Recordset.EOF Then

txtkode_poli.Text = Adodc1.Recordset!kode_poli

txtnama_poli.Text = Adodc1.Recordset!nama_poli

isi

tambah.Enabled = False

hapus.Enabled = True

ubah.Enabled = True

simpan.Enabled = False

keluar.Enabled = False

batal.Enabled = True

Else

MsgBox "Maaf, Data Tidak Ditemukan !"


End If

End Sub

Private Sub Form_Activate()

tdk_isi

tambah.Enabled = True

hapus.Enabled = True

ubah.Enabled = False

simpan.Enabled = False

keluar.Enabled = True

batal.Enabled = True

End Sub

Private Sub isi()

txtkode_poli.Enabled = True

txtnama_poli.Enabled = True

End Sub

Private Sub tdk_isi()

txtkode_poli.Enabled = False

txtnama_poli.Enabled = False

End Sub
Private Sub kosong()

txtkode_poli.Text = ""

txtnama_poli.Text = ""

End Sub

Private Sub hapus_Click()

Adodc1.Recordset.Delete

Call kosong

Adodc1.Recordset.Update

Adodc1.Refresh

tambah.Enabled = True

hapus.Enabled = True

ubah.Enabled = False

simpan.Enabled = False

keluar.Enabled = True

batal.Enabled = True

End Sub

Private Sub keluar_Click()

Unload Me

End Sub
Private Sub simpan_Click()

If txtkode_poli.Text = "" Then

MsgBox ("ANDA BELUM MEMASUKKAN KODE POLI DENGAN BENAR")

txtkode_poli.SetFocus

Else

If txtnama_poli.Text = "" Then

MsgBox ("ANDA BELUM MEMASUKKAN NAMA POLI DENGAN BENAR")

txtnama_poli.SetFocus

Else

Adodc1.Recordset.AddNew

Adodc1.Recordset.Fields("kode_poli") = txtkode_poli.Text

Adodc1.Recordset.Fields("nama_poli") = txtnama_poli.Text

Call kosong

Adodc1.Recordset.Update

Adodc1.Refresh

tambah.Enabled = True

hapus.Enabled = True

ubah.Enabled = False

simpan.Enabled = False

keluar.Enabled = True

batal.Enabled = True

End If

End If

End Sub
Private Sub tambah_Click()

isi

txtkode_poli.SetFocus

tambah.Enabled = False

ubah.Enabled = False

simpan.Enabled = True

batal.Enabled = True

hapus.Enabled = False

keluar.Enabled = False

End Sub

Private Sub ubah_Click()

If txtkode_poli.Text = "" Then

MsgBox ("ANDA BELUM MEMASUKKAN KODE POLI DENGAN BENAR")

txtkode_poli.SetFocus

Else

If txtnama_poli.Text = "" Then

MsgBox ("ANDA BELUM MEMASUKKAN NAMA POLI DENGAN BENAR")

txtama_poli.SetFocus

Else

Adodc1.Recordset.Update

Adodc1.Recordset.Fields("kode_poli") = txtkode_poli.Text

Adodc1.Recordset.Fields("nama_poli") = txtnama_poli.Text

MsgBox ("DATA SUDAH DISIMPAN")

Call kosong
Adodc1.Recordset.Update

Adodc1.Refresh

tambah.Enabled = True

hapus.Enabled = True

ubah.Enabled = False

simpan.Enabled = False

keluar.Enabled = True

batal.Enabled = True

End If

End If

End Sub

Anda mungkin juga menyukai