Tugas 2



Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
txtnama.SetFocus
txtnama = “”
txtnik = “”
txtgol = “”
txtks = “”
txtstatus = “”
txttahun = “”
txtjb = “”
txtbg = “”
txtgp = “”
txttj = “”
txttg = “”
txtterbilang = “”
End Sub
Private Sub cmdproses_Click()
Dim NIK As String
NIK = Mid(txtnik.Text, 9, 1)
If NIK = “A” Then
txtgol.Text = “A”
txtjb.Text = “MANAGER”
txtgp.Text = “3000000″
txttj.Text = “875000″
ElseIf NIK = “B” Then
txtgol.Text = “B”
txtjb.Text = “KA. SEKSI”
txtgp.Text = “2500000″
txttj.Text = “525000″
ElseIf NIK = “C” Then
txtgol.Text = “C”
txtjb.Text = “STAF”
txtgp.Text = “2000000″
txttj.Text = “325000″
End If

NIK = Mid(txtnik.Text, 5, 4)
txttahun.Text = NIK
NIK = Right(txtnik.Text, 1)
If NIK = “S” Then
txtks = “S”
txtstatus.Text = “SINGLE”
ElseIf NIK = “D” Then
txtks.Text = “D”
txtstatus.Text = “DUDA”
ElseIf NIK = “M” Then
txtks.Text = “M”
txtstatus.Text = “MENIKAH”
ElseIf NIK = “J” Then
txtks.Text = “J”
txtstatus.Text = “JANDA”
End If

NIK = Left(txtnik.Text, 3)
If NIK = “EDP” Then
txtbg.Text = “IT UNIT”
ElseIf NIK = “ADM” Then
txtbg.Text = “ADMINISTRASI”
ElseIf NIK = “SPM” Then
txtbg.Text = “SECURITY”
ElseIf NIK = “KEU” Then
txtbg.Text = “ACCOUNTING”
ElseIf NIK = “SDM” Then
txtbg.Text = “GENERAL AFFAIR”
End If

txttg.Text = Val(txtgp.Text) + Val(txttj.Text)
End Sub

……………………………………………………………………………………………………….


Private Sub cmdproses_Click()
Dim KODE As String
KODE = txtkode.Text
If KODE = “HB002T” Then
txtnama.Text = “TAPE”
txtharga.Text = “275000″
ElseIf KODE = “HT002S” Then
txtnama.Text = “SOUND SISTEM”
txtharga.Text = “350000″
ElseIf KODE = “HB002C” Then
txtnama.Text = “COMPACT”
txtharga.Text = “480000″
End If

txtterjual.Text = Val(txtstok.Text) – Val(txtsisa.Text)
txttotal.Text = Val(txtterjual.Text) * Val(txtharga.Text)
End Sub

Private Sub txtkode_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtstok.SetFocus
End If
End Sub

Private Sub txtsisa_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdproses.SetFocus
End If
End Sub

Private Sub txtstok_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtsisa.SetFocus
End If
End Sub

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s