TUGAS DATABASE 4

Gambar

Private Sub cmndbaru_Click()
Data1.Recordset.AddNew
txtnama.SetFocus
End Sub

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

Private Sub cmndkeluar_Click()
Unload Me
End Sub

Private Sub cmndproses_Click()
Dim s As String
Txttahun.Text = “20” & Left(Txtnpm.Text, 2)
s = Mid(Txtnpm.Text, 3, 1)
If s = “1” Then
txtjurusan.Text = “SistemInformasi”
ElseIf s = “2” Then
txtjurusan.Text = “tekhnikInformasi”
ElseIf s = “3” Then
txtjurusan.Text = “ManajemenInformatika”
ElseIf s = “4” Then
txtjurusan.Text = “komputerakutansi”
End If
s = Mid(Txtnpm.Text, 4, 2)
If s = “01” Then
txtps.Text = “Strata Satu”
ElseIf s = “02” Then
txtps.Text = “Diploma empat”
ElseIf s = “03” Then
txtps.Text = “Diploma Tiga”
ElseIf s = “04” Then
txtps.Text = “Diploma Dua”
End If
txtnourut.Text = Right(Txtnpm.Text, 3)
End Sub

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

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Iklan

Gambar
Private Sub Combo1_Click()
Dim gp, tjng, pjk, tt As Variant
Select Case Combo1.Text
Case “I”
gp = 2500000
tjng = 250000
Case “II”
gp = 2000000
tjng = 200000
Case “III”
gp = 1500000
tjng = 150000
Text3.Text = gp
Text4.Text = tjng
pjk = Val(Text3.Text) + Val(Text4.Text) * 0.1
Text5.Text = pjk
tt = Val(Text3.Text) + Val(Text4.Text) – Val(Text5.Text)
Text6.Text = tt
End If
End Sub
Private Sub Form_Load()
Combo1.AddItem “I”
Combo1.AddItem “II”
Combo1.AddItem “III”
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Gambar

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) * (Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Text1_Keypress(keyASCII As Integer)
If keyASCII = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_keypress(keyASCII As Integer)
If keyASCII = 13 Then
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If
End Sub

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.Text = Val(Text1.Text) * 0.1
End If
End Sub

Gambar
Private Sub Command1_Click()
Text7.Text = Val((Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 4
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub Command3_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Form_Load()

End Sub

Private Sub Text1_KeyPress(keyascii As Integer)
If keyascii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_keypress(keyascii As Integer)
If keyascii = 13 Then
Text3.SetFocus
End If
End Sub

Private Sub Text3_keypress(keyascii As Integer)
If keyascii = 13 Then
Text4.SetFocus
End If
End Sub

Private Sub Text4_keypress(keyascii As Integer)
If keyascii = 13 Then
Text5.SetFocus
End If
End Sub

Private Sub Text5_KeyPress(keyascii As Integer)
If keyascii = 13 Then
Text6.SetFocus
End If
End Sub

Gambar

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

Private Sub Command3_Click()
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub

Private Sub Command4_Click()
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub

Private Sub Command5_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
End Sub

Private Sub Command6_Click()
Unload Me
End Sub

Private Sub Form_Load()

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub