Private Sub cmdbatal_Click()
txtkode.SetFocus
txtkode = “”
txtnama = “”
txtstok = “”
txtsisa = “”
txtterjual = “”
txtharga = “”
txttotal = “”
txtterbilang = “”
End Sub
Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdproses_Click()
Dim KODE As String
KODE = txtkode.Text
If KODE = “HB002T” Then
txtnama.Text = “TAPE”
txtharga.Text = “275000″
ElseIf KODE = “HT002S” Then
txtnama.Text = “SOUND SISTEM”
txtharga.Text = “350000″
ElseIf KODE = “HB002C” Then
txtnama.Text = “COMPACT”
txtharga.Text = “480000″
End If

txtterjual.Text = Val(txtstok.Text) – Val(txtsisa.Text)
txttotal.Text = Val(txtterjual.Text) * Val(txtharga.Text)
End Sub

Private Sub txtkode_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtstok.SetFocus
End If
End Sub

Private Sub txtsisa_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdproses.SetFocus
End If
End Sub

Private Sub txtstok_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtsisa.SetFocus
End If
End Sub