LATIHAN 2

untitledYY

 

Private Sub cmdadd_Click()
Data1.Recordset.AddNew
txtkode.SetFocus
End Sub

 

Private Sub cmdcancel_Click()
Data1.Recordset.Delete
End Sub

 

Private Sub cmdhitung_Click()
txtby.Text = Val(txthb.Text) * Val(txtjb.Text)
If txtjb > 5 Then
txtpot = Val(txtby.Text) * 0.02
ElseIf txtjb < 5 Then
txtpot = 0
End If
txttb.Text = Val(txtby.Text) + Val(txtpot.Text)
End Sub

 

Private Sub cmdkeluar_Click()
Form2.Show
End Sub

 

Private Sub cmdproses_Click()
Dim KB As String
KB = Mid(txtkode.Text, 5, 2)
If KB = “SP” Then
txtnb = “Spidol”
txthb = 9500
ElseIf KB = “BT” Then
txtnb = “Buku Tulis”
txthb = 12500
ElseIf KB = “TP” Then
txtnb = “Tip Ex”
txthb = 3000
ElseIf KB = “PG” Then
txtnb = “Penggaris”
txthb = 25000
ElseIf KB = “PT” Then
txtnb = “Papan Tulis”
txthb = 50000
End If
End Sub

 

Private Sub cmdsave_Click()
Data1.Recordset.Update
End Sub

 

 

Private Sub cmdno_Click()
Form1.Show
End Sub

Private Sub cmdyes_Click()
End
End Sub

 

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s