
Microsoft Visual Basic 6.0 adalah sebuah bahasa pemrograman untuk Windows dan Internet. Sama seperti bahasa pemrograman Basic, Pascal, C dan lain-lain. Tetapi Basic, Pascal dan C ditujukan untuk sistem operasi Ms-DOS, sedangkan Visual Basic ditujukan untuk sistem operasi Windows dan Internet.
Jika Anda sudah memahami bahasa pemrograman Basic, maka Visual Basic sudah lebih mudah Anda pelajari, sebab sebagian besar perintah-perintah Visual Basic serupa dengan bahasa Basic.
Agar Anda dapat menggunakan Microsoft Visual Basic 6.0, maka software yang perlu Anda beli adalah Microsoft Visual Basic 6.0 Enterprise Edition atau Microsoft Visual Basic 6.0 Profesional. Panduan ini membahas Microsoft Visual Basic 6.0 Enterprise Edition, karena penggunaan software ini lebih banyak.
TUGAS AKHIR SKRIPSI IKMI MAJENANG
BIODATA PENULIS
Nama : Heri Novianto
TTL : Cilacap,
Alamat : Jl.Masjid Nurul yaqin,Al Jambesewuyi,RT 01/XI Cilopadang, Kec. Majenang,Cilacap
Jenis Kelamin : Laki-Laki
Pendidikan Formal
1. Sekolah Dasar : SD Negri 2 Majenang
2. Sekolah Lanjutan Tingkat I : SLTP N 3 Majenang
3. Sekolah Lanjutan Tingkat II : STM Muhammadiyah Majenang
Pendidikan Non Formal
Pendidikan Profesi 1 Tahun jurusan Manajemen Informatika IKMI Majenang Angkatan X Tahun 2008/2009
BIODATA PENULIS
Nama : Wisnu Supriyanto
TTL : Cilacap,08 Oktober 1988
Alamat : Jl.Masjid Nurul yaqin,Al Jambesewuyi,RT 03/XI Cilopadang, Kec. Majenang,Cilacap
Jenis Kelamin : Laki-Laki
Pendidikan Formal
1. Sekolah Dasar : SD Negri 2 Majenang
2. Sekolah Lanjutan Tingkat I : MTs El Bayan
3. Sekolah Lanjutan Tingkat II : SMA Purnama Majenang
Pendidikan Non Formal
Pendidikan Profesi 1 Tahun jurusan Manajemen Informatika IKMI Majenang Angkatan X Tahun 2008/2009
LISTING SCRIPT VB 6.0
'============================
'Prosedur Pada Cmd Start
'============================
Private Sub cmdstart_Click()
Data2.Recordset.INDEX = "USER"
Data2.Recordset.Seek "=", txtuser
If Data2.Recordset.NoMatch Then
MsgBox "USER TIDAK TERDAFTAR", vbOKOnly, "USER UPT DPU MAJENANG"
txtuser = ""
txtpass = ""
txtuser.SetFocus
Else
With Data2.Recordset
txtu.Text = !User
txtp.Text = !pass
End With
End If
'COCOKAN==================================
If txtuser = txtu And txtpass = txtp Then
Form20.Show
Unload Me
Else
MsgBox "PASSWORD SALAH", vbCritical, "USER UPT DPU MAJENANG"
txtuser = ""
txtpass = ""
txtuser.SetFocus
End If
End Sub
'============================
'Prosedur Pada Cmd Report
'============================
Private Sub cmdreport_Click()
CR1.WindowState = crptMaximized
CR1.RetrieveDataFiles
CR1.Action = 1
End Sub
'============================
'Prosedur Pada Cmd Batal
'============================
Private Sub cmdbatal_Click()
framasuk.Visible = False
End Sub
'============================
'Prosedur Pada txtuser
'============================
Private Sub txtuser_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpass.SetFocus
End If
End Sub
'============================
'Prosedur Pada MDIForm Load
'============================
Private Sub MDIForm_Load()
MENU.Show
End Sub
'============================
'Prosedur Pada Menu Induk Gaji
'============================
Private Sub mnuindukgaji_Click()
Form1.Show
End Sub
'============================
'Prosedur Pada Menu Induk Pegawai
'============================
Private Sub mnuindukpeg_Click()
Form2.Show
End Sub
'============================
'Prosedur Pada Menu Gaji Pegawai
'============================
Private Sub mnugajipeg_Click()
Form3.Show
End Sub
'============================
'Prosedur Pada Menu Daftar Gaji
'============================
Private Sub mnudaftargaji_Click()
Form6.Show
End Sub
'==============================
'Prosedur Pada Menu Report Pegawai
'==============================
Private Sub mnupeg_Click()
CR1.WindowState = crptMaximized
CR1.RetrieveDataFiles
CR1.Action = 1
End Sub
'==============================
'Prosedur Pada Menu Report Daftar Gaji
'==============================
Private Sub mnudafgaji_Click()
CR2.WindowState = crptMaximized
CR2.RetrieveDataFiles
CR2.Action = 1
End Sub
'==============================
'Prosedur Pada Menu About
'==============================
Private Sub mnuaboutgaji_Click()
Form16.Show
End Sub
'==============================
'Prosedur Pada Menu Programer
'==============================
Private Sub mnumadein_Click()
Form11.Show
End Sub
'==============================
'Prosedur Pada Menu Help
'==============================
Private Sub mnuprogram_Click()
Form19.Show
End Sub
'==============================
'Prosedur Pada Menu Exit
'==============================
Private Sub mnuexit_Click()
MsgBox "ARE YOU EXIT", vbOKCancel, "AL JAMBESEWUYYI"
If vbCanncel Then
MDIForm1.Show
Else
End
End If
End Sub
'==============================
'Prosedur form Activate
'==============================
Private Sub Form_Activate()
txtgol.SetFocus
End Sub
'==============================
'Prosedur Pada Label Keterangan
'==============================
Private Sub S1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblket.Caption = "SIMPAN KE DATABASE INDUKGAJI"
S1.Visible = False
Save.Visible = True
t1.Visible = True
Closed.Visible = False
End Sub
Private Sub T1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblket.Caption = "MENUTUP APLIKASI PROGRAM"
t1.Visible = False
Closed.Visible = True
S1.Visible = True
Save.Visible = False
End Sub
'==============================
'Prosedur Pada cmdSave
'==============================
Private Sub Save_Click()
With Data1.Recordset
.AddNew
!gol = txtgol.Text
!Nama_Jab = txtnamajab.Text
!GaPok = txtgapok.Text
!Tunjangan = txttunj.Text
!Tabperum = txttabperum.Text
.Update
End With
txtgol.Text = ""
txtnamajab.Text = ""
txtgapok.Text = ""
txttunj.Text = ""
txttabperum.Text = ""
txtgol.SetFocus
End Sub
'==============================
'Prosedur Pada txtKode
'==============================
Private Sub txtkode_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtgol.Text = "" Then
MsgBox "KODE JABATAN TIDAK BOLEH KOSONG", vbOKOnly, "CAUTION"
txtkode.SetFocus
Else
txtnamajab.SetFocus
End If
End If
End Sub
'==============================
'Prosedur Pada txtGol
'==============================
Private Sub txtgol_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtgol.Text = "" Then
MsgBox "NAMA JABATAN TIDAK BOLEH KOSONG", vbOKOnly, "CAUTION"
txtgol.SetFocus
Else
txtnamajab.SetFocus
End If
End If
End Sub
'==============================
'Prosedur Pada txtnama
'==============================
Private Sub txtnamajab_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtnamajab.Text = "" Then
MsgBox "NAMA JABATAN TIDAK BOLEH KOSONG", vbOKOnly, "CAUTION"
txtnamajab.SetFocus
Else
txtgapok.SetFocus
End If
End If
End Sub
'==============================
'Prosedur Pada txtgapok
'==============================
Private Sub txtgapok_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttunj.SetFocus
Else
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack Or KeyAscii = 13) Then MsgBox "DATA GAJI HARUS ANGKA", vbOKOnly, "CAUTION" txtgapok.SetFocus End If End If End Sub '============================== 'Prosedur Pada txttunj '============================== Private Sub txttunj_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack Or KeyAscii = 13) Then MsgBox "DATA TUNJANGAN HARUS ANGKA", vbOKOnly, "CAUTION" txttunj.SetFocus Else txttabperum.SetFocus End If End If End Sub '============================== 'Prosedur Pada Menu Report '============================== Private Sub cmdreport_Click() CR1.WindowState = crptMaximized CR1.RetrieveDataFiles CR1.Action = 1 End Sub Private Sub Closed_Click() Unload Me End Sub '============================== 'Prosedur form Activate '============================== Private Sub Form_Activate() txtnip.SetFocus End Sub '============================== 'Prosedur Pada txtnama '============================== Private Sub txtnama_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Data3.Recordset.INDEX = "nama" Data3.Recordset.Seek "=", txtnama With Data3.Recordset txtnip.Text = !NIP cmbpend.Text = !pendidikan cmbgol.Text = !gol txtjabatan.Text = !Jabatan txtalamat.Text = !alamat txtttl.Text = !ttl cmbsex.Text = !sex cmbstatus.Text = !Status cmbjmlanak.Text = !jmlanak cmbagama.Text = !agama End With End If End Sub '============================== 'Prosedur Pada NIP '============================== Private Sub txtnip_Change() If Len(txtnip.Text) = 21 Then txtnama.SetFocus End If End Sub Private Sub txtnip_KeyPress(KeyAscii As Integer) If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack Or KeyAscii = 13) Then MsgBox "NIP HARUS ANGKA", vbOKOnly, "ALJAMBESEWUYYI" txtnip = "" txtnip.SetFocus End If End Sub '============================== 'Prosedur Pada cmbgol '============================== Private Sub cmbgol_KeyPress(KeyAscii As Integer) Data1.Recordset.INDEX = "Gol" Data1.Recordset.Seek "=", cmbgol If Data1.Recordset.NoMatch Then MsgBox "KODE Gol JABATAN TIDAK ADA", vbOKOnly, "AL JAMBESEWUYYI" Else With Data1.Recordset txtjabatan.Text = !Nama_Jab txtgapok.Text = !GaPok txttunj.Text = !Tunjangan txttabperum = !Tabperum End With txtalamat.SetFocus End If End Sub '============================== 'Prosedur Pada Alamat '============================== Private Sub txtalamat_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtttl.SetFocus End If End Sub '============================== 'Prosedur Pada Menu Save '============================== Private Sub cmdsave_Click() With Data2.Recordset .AddNew !NIP = txtnip.Text !nama = txtnama.Text !pendidikan = cmbpend.Text !gol = cmbgol.Text !Tabperum = txttabperum.Text !Jabatan = txtjabatan.Text !Ga_Pok = txtgapok.Text !Tunjangan = txttunj.Text !alamat = txtalamat.Text !ttl = txtttl.Text !sex = cmbsex.Text !Status = cmbstatus.Text !jmlanak = cmbjmlanak.Text !agama = cmbagama.Text !TMT = DTtmt.Value .Update End With kosong End Sub '============================== 'Prosedur Pada Kosong '============================== Private Sub kosong() txtnip.Text = "" txtnama.Text = "" txtjabatan.Text = "" txtalamat.Text = "" txtttl.Text = "" cmbpend.Text = "" cmbgol.Text = "" cmbsex.Text = "" cmbstatus.Text = "" cmbagama.Text = "" cmbjmlanak.Text = "" txtnip.SetFocus End Sub '============================== 'Prosedur Pada Menu View '============================== Private Sub cmdview_Click() Form14.Show End Sub '============================== 'Prosedur Pada Menu Report '============================== Private Sub cmdreport_Click() CR1.WindowState = crptMaximized CR1.RetrieveDataFiles CR1.Action = 1 End Sub '============================== 'Prosedur Pada Menu Close '============================== Private Sub cmdclose_Click() Unload Me End Sub '============================== 'Prosedur Pada format tanggal '============================== Private Sub Form_Load() txtper = Format(Date, "mmmm") txttgl = Format(Date, "dd/mm/yyyy") End Sub '============================== 'Prosedur Pada cmbNIP '============================== Private Sub cmbnip_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Data1.Recordset.INDEX = "nip" Data1.Recordset.Seek "=", cmbnip If Data1.Recordset.NoMatch Then MsgBox "NIP YANG ANDA CARI TIDAK TERDAFTAR", vbOKOnly, "ALJAMBESEWUYYI" cmbnip = "" Else With Data1.Recordset txtnama.Text = !nama txtgol.Text = !gol txttabperum = !Tabperum txtjabatan.Text = !Jabatan txtgapok.Text = !Ga_Pok txttunjumum.Text = !Tunjangan txtistri.Text = !Status txtjmlanak.Text = !jmlanak txtpinjaman.Text = !pinjaman End With tunjistri tunjanak gator askes tunjberas pph penghslkotor potongan pinjaman gajitotal End If End If End Sub '============================== 'Prosedur Pada Tunjangan Istri '============================== Private Sub tunjistri() If txtistri = "Nikah" Then txttunjistri = Val(txtgapok.Text) * (10 / 100) Else txttunjistri = 0 End If End Sub '============================== 'Prosedur Pada Tunjangan Anak '============================== Private Sub tunjanak() If Val(txtjmlanak) <= 2 Then txttunjanak.Text = Val(txtjmlanak.Text) * (Val(txtgapok.Text) * (2 / 100)) Else txttunjanak.Text = 2 * (Val(txtgapok.Text) * (2 / 100)) End If End Sub ' ============================== 'Prosedur Pada Gator '============================== Private Sub gator() txtgator = Val(txtgapok) + Val(txttunjistri) + Val(txttunjanak) End Sub '=============================
'Prosedur Pada Tunjangan Askes
'=============================
Private Sub askes()
txttunjaskes = Val(txtgator.Text) * (2 / 100) End Sub Private Sub tunjberas() If txtistri = "Belumnikah" Then txttunjberas = 41580 ElseIf txtistri = "Nikah" And Val(txtjmlanak) <= 2 Then txttunjberas = (2 + Val(txtjmlanak)) * 41580 ElseIf txtistri = "Nikah" And Val(txtjmlanak) > 2 Then
txttunjberas = 4 * 41580
ElseIf txtistri = "Duda" Then
txttunjberas = 3 * 41580
End If
End Sub
'==============================
'Prosedur Pada Tunjangan PPH
'==============================
Private Sub pph()
txttunjpph = 21575
End Sub
'==============================
'Prosedur Pada Penghasilan Kotor
'==============================
Private Sub penghslkotor()
txtpenghslkotor = (Val(txtgator) + (Val(txttunjaskes) + Val(txttunjberas) + Val(txttunjpph)))
End Sub
'==============================
'Prosedur Pada Potongan
'==============================
Private Sub potongan()
txtpotaskes = txttunjaskes
txtpotpph = txttunjpph
txtpotiwp = Val(txtgator.Text) * (10 / 100)
txtjmlpotongan = (Val(txtpotaskes) + Val(txtpotpph) + Val(txtpotiwp) + Val(txttabperum))
End Sub
'==============================
'Prosedur Pada Gajitotal
'==============================
Private Sub gajitotal()
txtGATOT = Val(txtpenghslkotor) - Val(txtjmlpotongan)
'Terima Gaji Total================================
lblGATOT.Caption = Format(txtGATOT.Text, "Rp #,###")
End Sub
'==============================
'Prosedur Pada Save
'==============================
Private Sub lblsave_Click()
Data4.Recordset.INDEX = "NIP"
Data4.Recordset.Seek "=", cmbnip
If Data4.Recordset.NoMatch Then
With Data3.Recordset
.AddNew
!NIP = cmbnip.Text
!nama = txtnama.Text
!Jabatan = txtjabatan.Text
!Ga_Pok = txtgapok.Text
!tunj_Umum = txttunjumum.Text
!tunj_anak = txttunjanak.Text
!tunj_istri = txttunjistri
!tunj_Askes = txttunjaskes
!tunj_PPH = txttunjpph
!Pot_Askes = txtpotaskes
!Pot_PPH = txtpotpph
!Pot_IWP = txtpotiwp
!Tabperum = txttabperum
!Ga_Tot = lblGATOT
.Update
End With
Else
MsgBox "MAAF DATA SUDAH ADA", vbOKOnly, "PERINGATAN"
kosong
End If
End Sub
'==============================
'Prosedur Pada keterangan Option
'==============================
Private Sub Optview_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblket.Caption = "LIHAT SEMUA GAJI"
End Sub
Private Sub opttabungan_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblket.Caption = "SEBAGIAN GAJI AKAN DITABUNG"
End Sub
Private Sub Optreport_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblket.Caption = "REPORT GAJI PEGAWAI"
End Sub
Private Sub optclose_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblket.Caption = "MENUTUP APLIKASI"
End Sub
Private Sub lblsave_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblket.Caption = "SIMPAN DAFTAR GAJI"
End Sub
'==============================
'Prosedur Pada OptionView
'==============================
Private Sub Optview_Click()
Form6.Show
End Sub
'==============================
'Prosedur Pada Option Report
'==============================
Private Sub Optreport_Click()
CR1.WindowState = crptMaximized
CR1.RetrieveDataFiles
CR1.Action = 1
End Sub
'==============================
'Prosedur Pada Option Close
'==============================
Private Sub optclose_Click()
Unload Me
End Sub
0 komentar:
Posting Komentar