Senin, 24 Oktober 2011

Program Visual Basic Gaji Karyawan

Posted by Unknown On Senin, Oktober 24, 2011 | No comments


Sintaknya :

Private Sub Timer1_Timer()
tanggal = Format(Date, "dddd,d mmmm yyyy")
waktu = Format(Time, "hh:mm:ss")
Label1.Left = Label1.Left - 30
If Label1.Left < -5000 Then
Label1.Left = 11000
End If
End Sub

Private Sub Form_Activate()
cmbnip = "--NIP--"
cmbnip.AddItem "110011"
cmbnip.AddItem "120012"
cmbnip.AddItem "130013"
cmbnip.AddItem "140014"
txttoga.Enabled = False
txtnama.Enabled = False
txtgaji.Enabled = False
txtistri.Enabled = False
txtanak.Enabled = False
cmbnip.SetFocus
End Sub

Private Sub cmbnip_Click()
If cmbnip.Text = "110011" Then
txtnama.Text = "Rahima"
ElseIf cmbnip.Text = "120012" Then
txtnama.Text = "Zakia"
ElseIf cmbnip.Text = "130013" Then
txtnama.Text = "Intan"
Else
txtnama.Text = "Henry"
End If
End Sub

Private Sub Option1_Click()
txtgaji.Text = 5000000
End Sub

Private Sub Option2_Click()
txtgaji.Text = 3000000
End Sub

Private Sub Option3_Click()
txtgaji.Text = 2000000
End Sub

Private Sub Option4_Click()
txtgaji.Text = 1000000
End Sub

Private Sub Check1_Click()
If Option1.Value = True Then
ElseIf Check1.Value = 1 Then
txtistri.Text = 0.15 * Val(txtgaji.Text)
Else
txtistri.Text = 0
End If
If Option2.Value = True Then
ElseIf Check1.Value = 1 Then
txtistri.Text = 0.15 * Val(txtgaji.Text)
Else
txtistri.Text = 0
End If
If Option3.Value = True Then
ElseIf Check1.Value = 1 Then
txtistri.Text = 0.15 * Val(txtgaji.Text)
Else
txtistri.Text = 0
End If
If Option4.Value = True Then
ElseIf Check1.Value = 1 Then
txtistri.Text = 0.15 * Val(txtgaji.Text)
Else
txtistri.Text = 0
End If
End Sub

Private Sub Check2_Click()
If Option1.Value = True Then
ElseIf Check2.Value = 1 Then
txtanak.Text = 0.1 * Val(txtgaji.Text)
Else
txtanak.Text = 0
End If
If Option2.Value = True Then
ElseIf Check2.Value = 1 Then
txtanak.Text = 0.1 * Val(txtgaji.Text)
Else
txtanak.Text = 0
End If
If Option3.Value = True Then
ElseIf Check2.Value = 1 Then
txtanak.Text = 0.1 * Val(txtgaji.Text)
Else
txtanak.Text = 0
End If
If Option4.Value = True Then
ElseIf Check2.Value = 1 Then
txtanak.Text = 0.1 * Val(txtgaji.Text)
Else
txtanak.Text = 0
End If
End Sub

Private Sub cmdhitung_Click()
txttoga.Text = Val(txtgaji.Text) + Val(txtistri.Text) + Val(txtanak.Text)
cmdlagi.SetFocus
End Sub

Private Sub cmdlagi_Click()
cmbnip = "--NIP--"
txtnama.Text = " "
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Check1.Value = False
Check2.Value = False
txtgaji.Text = " "
txtistri.Text = " "
txtanak.Text = " "
txttoga.Text = " "
cmbnip.SetFocus
End Sub

Private Sub cmdexit_Click()
x = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Konfirmasi")
If x = vbYes Then
End
End If
End Sub

0 komentar:

Posting Komentar

Blog Archive

Blogroll