TUGAS VB 5

 

 

MEMBUAT DATA BASE

AFITA

Private Sub Cmdbaru_Click()
Data1.Recordset.AddNew
End Sub

Private Sub Cmdproses_Click()
Dim jur, ps As String
Txtth.Text = “20” & Left(Txtnpm.Text, 2)
jur = Mid(Txtnpm.Text, 3, 1)
If jur = “1” Then
TxtJurusan.Text = “Sistem Informasi”
ElseIf jur = “2” Then
TxtJurusan.Text = “Manajemen Informatika”
ElseIf jur = “3” Then
TxtJurusan.Text = “Tehnik Informatika”
End If

ps = Mid(TxtNPM.Text, 4, 2)
If ps = “01” Then
Txtprogram.Text = “Strata Satu”
ElseIf ps = “02” Then
Txtprogram.Text = “Diploma Tiga”
ElseIf ps = “03” Then
Txtprogram.Text = “Diploma Satu”
End If
TxtNurut.Text = Right(Txtnpm.Text, 3)
End Sub

Private Sub Cmdsimpan_Click()
Data1.Recordset.Update
End Sub

Private Sub Cmdhapus_Click()
Data1.Recordset.Delete
End Sub

Private Sub TxtNama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnpm.SetFocus
End If
End Sub

Private Sub Cmdkeluar_Click()
End
End Sub

 

Advertisements