Untuk Menu:
Private Sub mneditd_Click()
frmedit.Show
End Sub
Private Sub mninput_Click()
frminput.Show
End Sub
Untuk Input:
Private Sub cmdbatal_Click()
kosong
Text1.SetFocus
End Sub
Private Sub cmdsimpan_Click()
If Text1.Text = "" Then
x = MsgBox("data belum terisi semua", vbOKOnly)
Else
On Error Resume Next
Data1.Recordset.AddNew
Data1.Recordset!nip = Text1.Text
Data1.Recordset!nama = Text2.Text
Data1.Recordset!alamat = Text3.Text
Data1.Recordset!lahir = Text4.Text
Data1.Recordset!pendidikan = Text5.Text
Data1.Recordset!mapel = Text6.Text
Data1.Recordset!gaji = Text7.Text
Data1.Recordset!potongan = Text8.Text
Data1.Recordset!gaber = Text9.Text
Data1.Recordset.Update
kosong
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text1.SetFocus
kosong
End Sub
Private Sub kosong()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Text1_Change()
Text1.SetFocus
Dim skode As String
Dim strkode, strtipem As String
skode = Text1.Text
strkode = "dataguru" = "&skode"
Data1.Recordset.Index = "nip"
Data1.Recordset.Seek "=", Text1.Text
If Not Data1.Recordset.NoMatch Then
pesan = MsgBox("KODE SUDAH TERSEDIA, SILAHKEUN ISIKAN YANG LAIN..!!", vbOKOnly, "WARNING!!!")
Text2.Text = Data1.Recordset!nama
Text3.Text = Data1.Recordset!alamat
Text4.Text = Data1.Recordset!lahir
Text5.Text = Data1.Recordset!pendidikan
Text6.Text = Data1.Recordset!mapel
Text7.Text = Data1.Recordset!gaji
Text8.Text = Data1.Recordset!potongan
Text9.Text = Data1.Recordset!gaber
cmdbatal.SetFocus
Exit Sub
End If
End Sub
Private Sub Text9_LostFocus()
Text9.Text = Val(Text7.Text) - Val(Text8.Text)
End Sub
Untuk Edit:
Private Sub cmdbatal_Click()
kosong
Text1.SetFocus
End Sub
Private Sub cmdsimpan_Click()
If Text1.Text = "" Then
x = MsgBox("data belum terisi semua", vbOKOnly)
Else
On Error Resume Next
Data1.Recordset.AddNew
Data1.Recordset!nip = Text1.Text
Data1.Recordset!nama = Text2.Text
Data1.Recordset!alamat = Text3.Text
Data1.Recordset!lahir = Text4.Text
Data1.Recordset!pendidikan = Text5.Text
Data1.Recordset!mapel = Text6.Text
Data1.Recordset!gaji = Text7.Text
Data1.Recordset!gaber = Text8.Text
Data1.Recordset!jam = Text9.Text
Data1.Recordset.Update
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text1.SetFocus
kosong
End Sub
Private Sub kosong()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Text1_Change()
Text1.SetFocus
Dim skode As String
Dim strkode, strtipem As String
skode = Text1.Text
strkode = "dataguru" = "&skode"
Data1.Recordset.Index = "nip"
Data1.Recordset.Seek "=", Text1.Text
If Not Data1.Recordset.NoMatch Then
pesan = MsgBox("KODE SUDAH TERSEDIA, SILAHKEUN ISIKAN YANG LAIN..!!", vbOKOnly, "WARNING!!!")
Text2.Text = Data1.Recordset!nama
Text3.Text = Data1.Recordset!alamat
Text4.Text = Data1.Recordset!lahir
Text5.Text = Data1.Recordset!pendidikan
Text6.Text = Data1.Recordset!mapel
Text7.Text = Data1.Recordset!gaji
Text8.Text = Data1.Recordset!gaber
Text9.Text = Data1.Recordset!jam
Data1.Refresh
cmdbatal.SetFocus
Exit Sub
End If
End Sub
Selamat Mencoba...
Private Sub mneditd_Click()
frmedit.Show
End Sub
Private Sub mninput_Click()
frminput.Show
End Sub
Untuk Input:
Private Sub cmdbatal_Click()
kosong
Text1.SetFocus
End Sub
Private Sub cmdsimpan_Click()
If Text1.Text = "" Then
x = MsgBox("data belum terisi semua", vbOKOnly)
Else
On Error Resume Next
Data1.Recordset.AddNew
Data1.Recordset!nip = Text1.Text
Data1.Recordset!nama = Text2.Text
Data1.Recordset!alamat = Text3.Text
Data1.Recordset!lahir = Text4.Text
Data1.Recordset!pendidikan = Text5.Text
Data1.Recordset!mapel = Text6.Text
Data1.Recordset!gaji = Text7.Text
Data1.Recordset!potongan = Text8.Text
Data1.Recordset!gaber = Text9.Text
Data1.Recordset.Update
kosong
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text1.SetFocus
kosong
End Sub
Private Sub kosong()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Text1_Change()
Text1.SetFocus
Dim skode As String
Dim strkode, strtipem As String
skode = Text1.Text
strkode = "dataguru" = "&skode"
Data1.Recordset.Index = "nip"
Data1.Recordset.Seek "=", Text1.Text
If Not Data1.Recordset.NoMatch Then
pesan = MsgBox("KODE SUDAH TERSEDIA, SILAHKEUN ISIKAN YANG LAIN..!!", vbOKOnly, "WARNING!!!")
Text2.Text = Data1.Recordset!nama
Text3.Text = Data1.Recordset!alamat
Text4.Text = Data1.Recordset!lahir
Text5.Text = Data1.Recordset!pendidikan
Text6.Text = Data1.Recordset!mapel
Text7.Text = Data1.Recordset!gaji
Text8.Text = Data1.Recordset!potongan
Text9.Text = Data1.Recordset!gaber
cmdbatal.SetFocus
Exit Sub
End If
End Sub
Private Sub Text9_LostFocus()
Text9.Text = Val(Text7.Text) - Val(Text8.Text)
End Sub
Untuk Edit:
Private Sub cmdbatal_Click()
kosong
Text1.SetFocus
End Sub
Private Sub cmdsimpan_Click()
If Text1.Text = "" Then
x = MsgBox("data belum terisi semua", vbOKOnly)
Else
On Error Resume Next
Data1.Recordset.AddNew
Data1.Recordset!nip = Text1.Text
Data1.Recordset!nama = Text2.Text
Data1.Recordset!alamat = Text3.Text
Data1.Recordset!lahir = Text4.Text
Data1.Recordset!pendidikan = Text5.Text
Data1.Recordset!mapel = Text6.Text
Data1.Recordset!gaji = Text7.Text
Data1.Recordset!gaber = Text8.Text
Data1.Recordset!jam = Text9.Text
Data1.Recordset.Update
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text1.SetFocus
kosong
End Sub
Private Sub kosong()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Text1_Change()
Text1.SetFocus
Dim skode As String
Dim strkode, strtipem As String
skode = Text1.Text
strkode = "dataguru" = "&skode"
Data1.Recordset.Index = "nip"
Data1.Recordset.Seek "=", Text1.Text
If Not Data1.Recordset.NoMatch Then
pesan = MsgBox("KODE SUDAH TERSEDIA, SILAHKEUN ISIKAN YANG LAIN..!!", vbOKOnly, "WARNING!!!")
Text2.Text = Data1.Recordset!nama
Text3.Text = Data1.Recordset!alamat
Text4.Text = Data1.Recordset!lahir
Text5.Text = Data1.Recordset!pendidikan
Text6.Text = Data1.Recordset!mapel
Text7.Text = Data1.Recordset!gaji
Text8.Text = Data1.Recordset!gaber
Text9.Text = Data1.Recordset!jam
Data1.Refresh
cmdbatal.SetFocus
Exit Sub
End If
End Sub
Selamat Mencoba...