Tugas 6

TUGAS 6

Private Sub Command1_Click()

End

End Sub

Private Sub Command2_Click()

Form1.Show

End Sub

Private Sub cmdbatal_Click()

txtmnk.SetFocus

txtmnk.Text = “”

txtmn.Text = “”

txtgol.Text = “”

txtkode.Text = “”

txtstatus.Text = “”

txttahun.Text = “”

txtjabatan.Text = “”

txtbagian.Text = “”

txtgapok.Text = “”

Txttunj.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

Form2.Show

End Sub

 

Private Sub cmdproses_Click()

Dim r As String

r = Mid(txtmn.Text, 5, 1)

If r = “A” Then

txtgol = “A”

txtjabatan.Text = “MANAGER”

txtgapok.Text = “4000000”

txttunjangan.Text = “1025000”

ElseIf r = “B” Then

txtgol.Text = “B”

txtjabatan.Text = “Ka.SEKSI”

txtgapok.Text = “3500000”

txttunjangan.Text = “975000”

ElseIf r = “C” Then

txtgol.Text = “C”

txtjabatan.Text = “STAFF”

txtgapok.Text = “3000000”

txttunjangan.Text = “925000”

End If

r = Right(txtmn.Text, 3)

If r = “KEU” Then

txtbagian.Text = “ACCOUNTING”

ElseIf r = “ADM” Then

txtbagian.Text = “ADMINISTRASI”

ElseIf r = “SDM” Then

txtbagian.Text = “GENERAL AFFAIR”

ElseIf r = “EDP” Then

txtbagian.Text = “IT UNIT”

ElseIf r = “SPM” Then

txtbagian.Text = “SECURITY”

End If

r = Mid(txtmn.Text, 7, 1)

If r = “S” Then

kode = “S”

Status = “SINGLE”

ElseIf r = “M” Then

kode = “M”

Status = “MENIKAH”

ElseIf r = “J” Then

kode = “J”

Status = “JANDA”

ElseIf r = “D” Then

kode = “D”

Status = “DUDA”

End If

txtkode.Text = kode

txtstatus.Text = Status

txttahun.Text = Left(txtmn.Text, 4)

txttotal.Text = Val(txtgapok.Text) + Val(txttunjangan.Text)

End Sub

 

Private Sub Command1_Click()

Data1.Recordset.Update

End Sub

 

Private Sub Command2_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub Command3_Click()

Data1.Recordset.AddNew

End Sub

 

Private Sub Form_Activate()

txtmnk.SetFocus

End Sub

Private Sub txtmnk_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtmn.SetFocus

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