CARA MEMBUAT PROGRAM INPUT SISWA BARU

PROGRAM INPUT SISWA
Tampilan Program


Atur Form seperti gambar Lalu atur propertinya sebagai berikut:

Masukan Source Code -->

Private Sub baru_Click()
dbsiswa.Recordset.AddNew
nama1.Text = ""
nis1.Text = ""
tt1.Text = ""
tl1.Text = ""
kelas1.Text = ""
jur1.Text = ""
alamat1.Text = ""
nama1.Locked = False
nis1.Locked = False
tt1.Locked = False
tl1.Locked = False
kelas1.Locked = False
alamat1.Locked = False
nama1.SetFocus
End Sub

Private Sub kosong_Click()
nama1.Text = ""
nis1.Text = ""
tt1.Text = ""
tl1.Text = ""
kelas1.Text = ""
jur1.Text = ""
alamat1.Text = ""
End Sub

Private Sub Command8_Click()
Unload Me
End Sub

Private Sub hapus_Click()
dbsiswa.Recordset.Delete
End Sub
Private Sub nis1_Change()
Dim j As String
j = Right(nis1.Text, 1)
If j = "1" Then
jur1.Text = "Teknik Komputer & Jaringan"
ElseIf j = "2" Then
jur1.Text = "Multimedia"
ElseIf j = "3" Then
jur1.Text = "Teknik Sepeda Motor"
ElseIf j = "4" Then
jur1.Text = "Teknik Kendaraan Ringan"
ElseIf j = "5" Then
jur1.Text = "Akuntansi"
ElseIf j = "6" Then
jur1.Text = "Administrasi Perkantoran"
ElseIf j = "7" Then
jur1.Text = "Tata Niaga"
End If
End Sub

Private Sub simpan1_Click()
dbsiswa.Recordset!nama = nama1.Text
dbsiswa.Recordset!nis = nis1.Text
dbsiswa.Recordset!tempat = tt1.Text
dbsiswa.Recordset!tgl_lahir = tl1.Text
dbsiswa.Recordset!kelas = kelas1.Text
dbsiswa.Recordset!jurusan = jur1.Text
dbsiswa.Recordset!alamat = alamat1.Text

End Sub

Private Sub simpan2_Click()
dbsiswa.Recordset!nama = nama2.Text
dbsiswa.Recordset!nis = nis2.Text
dbsiswa.Recordset!tempat = tt2.Text
dbsiswa.Recordset!tgl_lahir = tl2.Text
dbsiswa.Recordset!kelas = kelas2.Text
dbsiswa.Recordset!jurusan = jur2.Text
dbsiswa.Recordset!alamat = alamat2.Text
End Sub

Selesai silahkan coba........