You are on page 1of 3

Public Sub Text_Mati()

Text1.Enabled = False
Text2.Enabled = False
MonthView1.Enabled = False
Text3.Enabled = False
End Sub

Public Sub Text_Hidup()


Text1.Enabled = True
Text2.Enabled = True
MonthView1.Enabled = True
Text3.Enabled = True
End Sub

Public Sub Text_Kosong()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Command1_Click()
Text_Hidup
Text1.SetFocus
End Sub

Private Sub Command2_Click()


With Adodc1.Recordset
On Error Resume Next
.MoveFirst
.Find "Norm = '" & Text1.Text & "'"
If .EOF Then
.AddNew
!Norm = Text1.Text
!Nama = Text2.Text
!Tgllahir = MonthView1.Value
!Pembayaran = Text3.Text
.Update
End If
On Error GoTo 0
End With
Text_Mati
Text_Kosong
End Sub
Private Sub Command3_Click()
With Adodc1.Recordset
On Error Resume Next
.MoveFirst
.Find "Norm = '" & Text1.Text & "'"
If Not .EOF Then
Text1.Text = !Norm
Text2.Text = !Nama
MonthView1.Value = !Tgllahir
Text3.Text = !Pembayaran
End If
On Error GoTo 0
End With
End Sub

Private Sub Command4_Click()


With Adodc1.Recordset
!Norm = Text1.Text
!Nama = Text2.Text
!Tgllahir = MonthView1.Value
!Pembayaran = Text3.Text
End With
Text_Mati
Text_Kosong
End Sub

Private Sub Command5_Click()


With Adodc1.Recordset
.Delete
End With
Text_Mati
Text_Kosong
End Sub

Private Sub Command6_Click()


Text_Mati
Text_Kosong
End Sub
Private Sub Command7_Click()
End
End Sub

Private Sub Command8_Click()


Adodc1.Recordset.Filter = "Nama like '*" & Text2.Text & "*'"
End Sub

Private Sub Form_Load()


Text_Mati
End Sub

Private Sub Command1_Click()


With Form1.Adodc1.Recordset
.MoveFirst
.Find "Norm = '" & Text2.Text & "'"
If Not .EOF Then
Text6.Text = !Nama
Text7.Text = !Pembayaran
Text3.Text = Val(Now - !Tgllahir)
Text8.Text = Val(Text3.Text / 365)
End If
End With
End Sub

You might also like