Tugas 13

TUGAS 13

Private Sub Command1_Click()

Form1.Show

End Sub

 

Private Sub Command2_Click()

End

End Sub

 

Private Sub cbokode_Click()

Dim jk, hs, HB As Integer

Select Case cbokode.Text

Case “P205”

jk = “Pentium II 500 Mega Hz”

hs = “1500000”

Case “P308”

jk = “Pentium III 800 Mega Hz”

hs = “2100000”

Case “P310”

jk = “Pentium III 1.0 Mega Hz”

hs = “3500000”

Case “P415”

jk = “Pentium IV 1.5 Mega Hz”

hs = “4000000”

Case “P417”

jk = “Pentium IV 1.7 Mega Hz”

hs = “4200000”

Case “P419”

jk = “Pentium IV 1.9 Mega Hz”

hs = “5500000”

End Select

txtjk.Text = jk

txths.Text = hs

txtbayar.SetFocus

 

 

End Sub

 

Private Sub cmdbaru_Click()

Data1.Recordset.AddNew

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub cmdhitung_Click()

cbokode.SetFocus

cbokode.Text = “”

txtjk.Text = “”

txths.Text = “”

txtjj.Text = “”

txthp.Text = “”

txtdiskon.Text = “”

txtbayar.Text = “”

 

End Sub

 

Private Sub cmdkeluar_Click()

Form2.Show

End Sub

 

Private Sub cmdproses_Click()

txthp.Text = Val(txths) * Val(txtjj)

Select Case txthp.Text

Case Is > 40000000

txtdiskon.Text = Val(txthp) * 0.15

Case Is > 35000000

txtdiskon.Text = Val(txthp) * 0.1

Case Is > 30000000

txtdiskon.Text = Val(txthp) * 0.05

Case Is > 25000000

txtdiskon.Text = Val(txthp) * 0.02

End Select

txtbayar.Text = Val(txthp) – Val(txtdiskon)

 

 

End Sub

 

Private Sub cmdsimpan_Click()

Data1.Recordset.Update

End Sub

 

Private Sub Form_Load()

cbokode.AddItem “P205”

cbokode.AddItem “P308”

cbokode.AddItem “P310”

cbokode.AddItem “P415”

cbokode.AddItem “P417”

cbokode.AddItem “P419”

 

End Sub

 

Private Sub txtjj_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txthp.Text = Val(txthp) * Val(txtjj)

Select Case txthp.Text

Case Is > 40000000

txtdiskon.Text = Val(txthp) * 0.15

Case Is > 35000000

txtdiskon.Text = Val(txthp) * 0.1

Case Is > 30000000

txtdiskon.Text = Val(txthp) * 0.05

Case Is > 25000000

txtdiskon.Text = Val(txthp) * 0.02

End Select

txtbayar.Text = Val(txthp) – Val(txtdiskon)

End If

 

End Sub

 

 

 

 

 

 

Advertisements

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