tugas 9.1

AB9

Private Sub Cmdproses_Click()
Dim A As String
A = Mid(Txtkt.Text, 1, 3)
If A = “BIM” Then
Txtht.Text = 50000
Txtjk.Text = “BIMA”
Txtjb.Text = “16.00”
ElseIf A = “EKO” Then
Txtht.Text = 35000
Txtjk.Text = “EKONOMI”
Txtjb.Text = “19.00”
ElseIf A = “MUT” Then
Txtht.Text = 23000
Txtjk.Text = “MUTIARA”
Txtjb.Text = “17.00”
ElseIf A = “SEN” Then
Txtht.Text = 15000
Txtjk.Text = “SENJA”
Txtjb.Text = “20.00”
End If
Txttotalp.Text = Val(Txtht.Text) * Val(Txtjt.Text)

End Sub

Private Sub Cmdlagi_Click()
Txtkt.SetFocus
Txtkt.Text = “”
Txtht.Text = “”
Txtjk.Text = “”
Txtjb.Text = “”
Txtjt.Text = “”
Txttotalp.Text = “”
End Sub

Private Sub Txtkt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtjt.SetFocus
End If
End Sub

Private Sub Cmdkeluar_Click()
Unload Me

Advertisements