soedirman15@gmail.com atau WA 085740291996

Sabtu, 17 Maret 2012

Aplikasi Perhitungan Gaji Dengan VB 6.0



Dim a As Single, b As Single, c As Single, hasil As Single



Private Sub cmd_Click()
a = Text5.Text
b = Text8.Text
c = Text9.Text
hasil = (a + b) + c
Text10.Text = hasil
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Len(Text1) < 5 Then
MsgBox "NIK harus di isi dengan 5 Digit", vbInformation + vbOKCancel, "Kesalahan"
Else
Text2.SetFocus
End If
End If

End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Len(Text2) = 0 Then
MsgBox "Nama Wajib Di Isi", vbInformation + vbOKCancel, "Kesalahan"
Else
Text3.SetFocus
End If
End If
End Sub



Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
If Text3 = "A" Then
Text5 = 1000000
ElseIf Text3 = "B" Then
Text5 = 1500000
ElseIf Text3 = "C" Then
Text5 = 2000000
ElseIf Text3 = "D" Then
Text5 = 2500000
Else
MsgBox "Harus d isi A,B,C, atau D", vbInformation + vbOKCancel, "Kesalahan"
End If
Text4.SetFocus

End If

End Sub



Private Sub Text4_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
If Text4 = "L" Or Text4 = "P" Then

Text6.SetFocus
Else
MsgBox "L=Laki-laki  P=Perempuan", vbInformation + vbOKCancel, "Kesalahan"
End If
End If
End Sub





Private Sub Text5_KeyPress(KeyAscii As Integer)

MsgBox "Nama Wajib Di Isi", vbInformation + vbOKCancel, "Kesalahan"
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
If Text6 = "K" And Text4 = "L" Then
Text8 = (10 / 100) * Text5
ElseIf Text6 = "T" And Text4 = "L" Or Text4 = "P" Then
Text8 = 0

Else
MsgBox "K=Menikah T+tidak menikah", vbInformation + vbOKCancel, "Kesalahan"
End If
Text7.SetFocus

End If
End Sub

Private Sub Text7_Change()
If KeyAscii = 13 Then
If Text7 = "1" Then
Text9 = (10 / 100) * Text5
ElseIf Text7 >= "2" Then
Text9 = (15 / 100) * Text5
Else
MsgBox "Berisi Angka", vbInformation + vbOKCancel, "Kesalahan"
End If
Text10.SetFocus
End If
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
If Text7 = "1" Then
Text9 = (10 / 100) * Text5
ElseIf Text3 >= "2" Then
Text9 = (15 / 100) * Text5

Else
MsgBox "Berisi Angka", vbInformation + vbOKCancel, "Kesalahan"
End If
Text4.SetFocus

End If
End Sub

3 komentar:

  1. stelah ku cari2 ternyata nemu juga..

    maksih gan atas postingnya..

    gan boleh di kopasa ya buat bikin tugas akhir...

    makasih gan...

    BalasHapus
  2. eh maaf kalu bikin apikasi ini di butuhka databes ga ya....

    BalasHapus
  3. okey gan,,copas j,,asal d pelajari lagi,,kalau yang database belum aku post,,

    BalasHapus