TUGAS 2 VB

visual basic


Private Sub Cmdproses_Click()
Dim nik As String
txtgol.Text = Left(Txtnik.Text, 1)
nik = Left(Txtnik.Text, 1)
If nik = “A” Then
txtgol.Text = “A”
txtjbt.Text = “manager”
txtgapok.Text = 2500000
txttj.Text = 375000
ElseIf nik = “B” Then
txtgol.Text = “B”
txtjbt.Text = “kepala seksi”
txtgapok.Text = “1500000″
txttj.Text = 375000
ElseIf nik = “C” Then
txtgol.Text = “C”
txtjbt.Text = “staf”
txtgapok.Text = 1000000
txttj.Text = 250000
End If
txtgatot.Text = Val(txtgapok.Text) + Val(txttj.Text)

nik = Mid(Txtnik.Text, 2, 4)
txtth.Text = nik

nik = Mid(Txtnik.Text, 6, 3)
If nik = “keu” Then
txtbag.Text = “accounting’”
ElseIf nik = “adm” Then
txtbag.Text = “administrasion”
ElseIf nik = “sdm” Then
txtbag.Text = “general affair”
ElseIf nik = “edp” Then
txtbag.Text = “it unit”
ElseIf nik = “spm” Then
txtbag.Text = “security”
End If

nik = Right(Txtnik.Text, 1)
If nik = “S” Then
txtks.Text = “S”
txtts.Text = “Single”
ElseIf nik = “M” Then
txtks.Text = “M”
txtts.Text = “Menikah”
End If

End Sub
Private Sub Cmdbatal_Click()
txtgol.SetFocus
txtgol.Text = “”
txtks.Text = “”
txtts.Text = “”
txtth.Text = “”
txtjbt.Text = “”
txtbag.Text = “”
txtgapok.Text = “”
txttj.Text = “”
txtgatot.Text = “”
txtnamakaryawan.Text = “”
Txtnik.Text = “”
End Sub
Private Sub Cmdlagi_Click()
txtgol.SetFocus
txtgol.Text = “”
txtks.Text = “”
txtts.Text = “”
txtth.Text = “”
txtjbt.Text = “”
txtbag.Text = “”
txtgapok.Text = “”
txttj.Text = “”
txtgatot.Text = “”
txtnamakaryawan.Text = “”
Txtnik.Text = “”
End Sub
Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub txtgol_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtks.SetFocus
End If
End Sub

Private Sub txtks_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtts.SetFocus
End If
End Sub
Private Sub txtts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtth.SetFocus
End If
End Sub
Private Sub txtth_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtjbt.SetFocus
End If
End Sub
Private Sub txtjbt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtbag.SetFocus
End If
End Sub
Private Sub txtbag_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtgapok.SetFocus
End If
End Sub
Private Sub txtgapok_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttj.SetFocus
End If
End Sub
Private Sub txttj_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtgatot.SetFocus
End If
End Sub

Iklan
Pos ini dipublikasikan di Uncategorized. Tandai permalink.

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 )

Foto Google+

You are commenting using your Google+ 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 )

Connecting to %s