Dim yos As Database
Dim pengki As Recordset
Private Sub Form_Load()
Data1.Visible = False
Set yos = OpenDatabase(App.Path & "/yosvb.mdb")
Set pengki = yos.OpenRecordset("yosmhs", dbOpenTable, dbAppendOnly)
pengki.Index = "yoskumun"
yosform
ynpm.MaxLength = 8
End Sub
Private Sub yosform()
ynpm.Text = ""
ynm.Text = ""
ytmp.Text = ""
ytgl.Text = ""
yjk.Text = ""
yal.Text = ""
yosta.Enabled = True
yossi.Enabled = True
yosha.Enabled = True
yoske.Enabled = True
End Sub
Private Sub yostaktif()
ynm.Enabled = False
ynpm.Enabled = False
ytmp.Enabled = False
ytgl.Enabled = False
yjk.Enabled = False
yal.Enabled = False
yosta.Enabled = True
yossi.Enabled = True
yosha.Enabled = False
yoske.Enabled = True
End Sub
Private Sub ynpm_Change()
If Not pengki.BOF Then
pengki.MoveFirst
End If
pengki.Seek "=", ynpm.Text
If pengki.NoMatch Then
Exit Sub
End If
ynpm.Text = pengki!npm
ynm.Text = pengki!nama
ytmp.Text = pengki!tempat
ytgl.Text = pengki!tgl
yjk.Text = pengki!jk
yal.Text = pengki!almt
yoske.Enabled = True
yosta.Enabled = True
yossi.Enabled = True
yosha.Enabled = True
End Sub
Private Sub yosha_Click()
Dim psn As Integer
psn = MsgBox("Yakin Mau Dihapus....!!!!", vbQuestion + vbYesNo, "pesan")
If psn = vbYes Then
pengki.Delete
ynpm.SetFocus
yosform
End If
End Sub
Private Sub yoske_Click()
Unload Me
End Sub
Private Sub yossi_Click()
pengki.AddNew
pengki!npm = ynpm.Text
pengki!nama = ynm.Text
pengki!tempat = ytmp.Text
pengki!tgl = ytgl.Text
pengki!jk = yjk.Text
pengki!almt = yal.Text
pengki.Update
ynpm.SetFocus
yosform
End Sub
Private Sub yosta_Click()
yosform
ynpm.SetFocus
End Sub
Tidak ada komentar:
Posting Komentar