tugas8

program8

Private Sub Cmdkeluar_Click()

End

End Sub

Private Sub Cmdlagi_Click()

Txtkode.SetFocus

Txtkode.Text = “”

Txtharga.Text = “”

Txtjenis.Text = “”

Txtjam.Text = “”

Txtjumlah.Text = “”

Txttotal.Text = “”

End Sub

Private Sub Cmdproses_Click()

Dim S As String

S = Left(Txtkode.Text, 3)

If S = “BIM” Then

Txtjenis.Text = “BIMA”

Txtharga.Text = “50000”

Txtjam.Text = “16.00”

ElseIf S = “EKO” Then

Txtjenis.Text = “EKONOMI”

Txtharga.Text = “35000”

Txtjam.Text = “19.00”

ElseIf S = “MUT” Then

Txtjenis.Text = “MUTIARA”

Txtharga.Text = “23000”

Txtjam.Text = “17.00”

ElseIf S = “SEN” Then

Txtjenis.Text = “SENJA”

Txtharga.Text = “15000”

Txtjam.Text = “20.00”

End If

Txtjumlah.SetFocus

End Sub

Private Sub Txtjumlah_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txttotal.Text = Val(Txtharga.Text) * Val(Txtjumlah.Text)

End If

End Sub

Iklan