tugas 4

IMG_20160103_215237

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Cbokode.SetFocus

Cbokode.Text = “”

Txtjual.Text = “”

Txtmerk.Text = “”

Txtharga.Text = “”

Txthp.Text = “”

Txtdis.Text = “”

Txttotal.Text = “”

End Sub

 

Private Sub Cmdproses_Click()

Dim diskon As String

Txthp.Text = Val(Txtjual * Txtharga)

Select Case Txthp.Text

Case Is > 140000000

diskon = Val(Txthp * 0.15)

Case Is > 135000000

diskon = Val(Txthp * 0.1)

Case Is > 130000000

diskon = Val(Txthp * 0.05)

Case Is > 125000000

diskon = Val(Txthp * 0.02)

End Select

Txtdis.Text = diskon

Txttotal.Text = Val(Txthp – Txtdis)

End Sub

 

Private Sub Cbokode_Click()

Dim J As String

J = Mid(Cbokode.Text, 7, 5)

If J = “MC965” Then

Txtmerk.Text = “Apple MacBook Air MC965”

Txtharga.Text = “12800000”

ElseIf J = “MC966” Then

Txtmerk.Text = “Apple MacBook Air MC966”

Txtharga.Text = “15800000”

ElseIf J = “MC968” Then

Txtmerk.Text = “Apple MacBook Air MC968”

Txtharga.Text = “9900000”

ElseIf J = “MC969” Then

Txtmerk.Text = “Apple MacBook Air MC969”

Txtharga.Text = “11900000”

ElseIf J = “MC700” Then

Txtmerk.Text = “Apple MacBook Pro MC700”

Txtharga.Text = “10800000”

ElseIf J = “MC721” Then

Txtmerk.Text = “Apple MacBook Pro MC721”

Txtharga.Text = “15900000”

ElseIf J = “MC723” Then

Txtmerk.Text = “Apple MacBook Pro MC723”

Txtharga.Text = “19300000”

ElseIf J = “MC724” Then

Txtmerk.Text = “Apple MacBook Pro MC724”

Txtharga.Text = “13700000”

ElseIf J = “MC311” Then

Txtmerk.Text = “Apple MacBook Pro MC311”

Txtharga.Text = “24200000”

ElseIf J = “MC313” Then

Txtmerk.Text = “Apple MacBook Pro MC313”

Txtharga.Text = “11900000”

ElseIf J = “MC314” Then

Txtmerk.Text = “Apple MacBook Pro MC314”

Txtharga.Text = “14700000”

ElseIf J = “MC318” Then

Txtmerk.Text = “Apple MacBook Pro MC318”

Txtharga.Text = “17600000”

ElseIf J = “MC322” Then

Txtmerk.Text = “Apple MacBook Pro MC322”

Txtharga.Text = “21300000”

End If

Txtjual.SetFocus

End Sub

 

Private Sub Form_Load()

Cbokode.AddItem “Aplle MC965 MacBook Air”

Cbokode.AddItem “Aplle MC966 MacBook Air”

Cbokode.AddItem “Aplle MC968 MacBook Air”

Cbokode.AddItem “Aplle MC969 MacBook Air”

Cbokode.AddItem “Aplle MC700 MacBook Pro”

Cbokode.AddItem “Aplle MC721 MacBook Pro”

Cbokode.AddItem “Aplle MC723 MacBook Pro”

Cbokode.AddItem “Aplle MC724 MacBook Pro”

Cbokode.AddItem “Aplle MC311 MacBook Pro”

Cbokode.AddItem “Aplle MC313 MacBook Pro”

Cbokode.AddItem “Aplle MC314 MacBook Pro”

Cbokode.AddItem “Aplle MC318 MacBook Pro”

Cbokode.AddItem “Aplle MC322 MacBook Pro”

End Sub

Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s