Database

Private Sub Cmdproses_Click()
Dim KB As String
KB = Right(txtKB.Text, 1)
If KB = “T” Then
txtNB.Text = “Tape”
txtHJ.Text = “275000”
ElseIf KB = “S” Then
txtNB.Text = “Sound System”
txtHJ.Text = “350000”
ElseIf KB = “C” Then
txtNB.Text = “Compact”
txtHJ.Text = “480000”
End If
txtTJ.SetFocus

End Sub

Private Sub Cmdbatal_Click()
txtKB.SetFocus
txtKB.Text = “”
txtNB.Text = “”
txtJS.Text = “”
txtSS.Text = “”
txtTJ.Text = “”
txtHJ.Text = “”
txtTH.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub txtKB_KeyPress(keyascii As Integer)
If keyascii = 13 Then
txtNB.SetFocus
End If
End Sub
Private Sub txtNB_KeyPress(keyascii As Integer)
If keyascii = 13 Then
txtJS.SetFocus
End If
End Sub
Private Sub txtJS_KeyPress(keyascii As Integer)
If keyascii = 13 Then
txtTJ.SetFocus
End If
End Sub
Private Sub txtTJ_keypress(keyascii As Integer)
If keyascii = 13 Then
txtSS.Text = Val(txtJS.Text) – Val(txtTJ.Text)
txtTH.Text = Val(txtTJ.Text) * Val(txtHJ.Text)
End If
End Sub
Private Sub txtHJ_KeyPress(keyascii As Integer)
If keyascii = 13 Then
txtTH.SetFocus
End If
End Sub

Tinggalkan komentar