Gaji Pegawai

Posted: 15 Februari 2013 in Tugas3

9

 

Private Sub cbogol_Click()

Dim a, b, c, d As Variant

Select Case cbogol.Text

Case “I”

a = “1500000”

b = “250000”

Case “II”

a = “2000000”

b = “500000”

Case “III”

a = “2500000”

b = “750000”

Case “IV”

a = “3000000”

b = “1000000”

End Select

c = (Val(a) + Val(b)) * 0.1

d = Val(a) + Val(b) – Val(c)

txtpokok.Text = a

txttunjangan.Text = b

txtpajak.Text = c

txttotal.Text = d

End Sub

———————————————————————————

Private Sub cmdbatal_Click()

kosong

End Sub

 

Private Sub cmdlagi_Click()

kosong

End Sub

———————————————————————————

 

Private Sub cmdx_Click()

End

End Sub

———————————————————————————

 

Private Sub Form_Load()

cbogol.AddItem “I”

cbogol.AddItem “II”

cbogol.AddItem “III”

cbogol.AddItem “IV”

End Sub

———————————————————————————

 

Private Sub kosong()

txtnidn = “”

txtnama = “”

txtpokok = “”

txttunjangan = “”

txtpajak = “”

txttotal = “”

cbogol.Text = “Pilih Golongan”

txtnidn.SetFocus

End Sub

———————————————————————————

 

Private Sub txtnama_keypress(keyascii As Integer)

If keyascii = 13 Then

cbogol.SetFocus

End If

End Sub

———————————————————————————

 

Private Sub txtnidn_keypress(keyascii As Integer)

If keyascii = 13 Then

txtnama.SetFocus

End If

End Sub

Font & Color Part II

Posted: 15 Februari 2013 in Tugas3

8

Private Sub cmdOK_Click()

lblout.Caption = txtinput.Text

If optblue.Value = True Then

lblout.ForeColor = vbBlue

ElseIf optred.Value = True Then

lblout.ForeColor = vbRed

End If

If chcbold.Value = 1 Then

lblout.FontBold = True

Else: lblout.FontBold = False

End If

If chcmiring.Value = 1 Then

lblout.FontItalic = True

Else: lblout.FontItalic = False

End If

End Sub

———————————————————————————–

Private Sub cmdselesai_Click()

End

End Sub

 

 

 

Data Mahasiswa

Posted: 15 Februari 2013 in Tugas3

7

Private Sub cmdbatal_Click()

txtnama.SetFocus

Call kosong

End Sub

——————————————————————————–

Private Sub cmdlagi_Click()

txtnama.SetFocus

Call kosong

End Sub

——————————————————————————–

 

Private Sub cmdproses_Click()

txtmasuk.Text = “20” & Left(txtnpm.Text, 2)

txturut.Text = Right(txtnpm.Text, 3)

b = Mid(txtnpm.Text, 4, 2)

If b = “01” Then

txtps.Text = “Strata Satu”

ElseIf b = “02” Then

txtps.Text = “Diploma Tiga”

ElseIf b = “03” Then

txtps.Text = “Diploma Dua”

ElseIf b = “04” Then

txtps.Text = “Diploma Satu”

End If

a = Mid(txtnpm.Text, 3, 1)

If a = “1” Then

txtjurusan.Text = “Sistem Informasi”

ElseIf a = “2” Then

txtjurusan.Text = “Manajemen Informatika”

ElseIf a = “3” Then

txtjurusan.Text = “Komputer Akuntansi”

ElseIf a = “4” Then

txtjurusan.Text = “Teknik Informatika”

End If

End Sub

——————————————————————————–

 

Private Sub cmdx_Click()

Unload Me

 

End Sub

——————————————————————————–

 

Private Sub kosong()

txtnama = “”

txtnpm = “”

txtjurusan = “”

txtps = “”

txtmasuk = “”

txturut = “”

End Sub

——————————————————————————–

 

Private Sub txtnama_keypress(keyascii As Integer)

If keyascii = 13 Then

txtnpm.SetFocus

End If

End Sub

——————————————————————————–

 

Private Sub txtnpm_keypress(keyascii As Integer)

If keyascii = 13 Then

cmdproses.SetFocus

End If

End Sub

Huruf Mutu Mahasiswa

Posted: 15 Februari 2013 in Tugas3

6

Private Sub cbonpm_Click()

Dim Nama, Jurusan, mutu As String

Select Case cbonpm.Text

Case “12101691”

Nama = “Agil Ramadhan”

Jurusan = “Sistem Informatika”

Case “11201692”

Nama = “Belalang Kupukupu”

Jurusan = “Teknik Informasi”

Case “11102693”

Nama = “Akim Sialmulu”

Jurusan = “Manajemen Informatika”

Case “12304694”

Nama = “Ponti Abalabal”

Jurusan = “Komputer Akutansi”

End Select

txtnama.Text = Nama

txtjurusan.Text = Jurusan

txtkuis.SetFocus

End Sub

————————————————————-

Private Sub cmdbtl_Click()

cbonpm.SetFocus

cbonpm.Text = “Silahkan Pilih NPM”

txtnama = “”

txtjurusan = “”

txtkuis = “”

txtuas = “”

txtuts = “”

txttugas = “”

txtakhir = “”

txtmutu = “”

End Sub

———————————————————————

Private Sub cmdexit_Click()

End

End Sub

——————————————————————————

Private Sub cmdproses_Click()

Dim mutu As String

txtakhir = (Val(txttugas.Text) + Val(txtuts.Text) + Val(txtuas.Text) + Val(txtkuis.Text)) / 4

Select Case txtakhir.Text

Case Is > 80

mutu = “A”

Case Is > 70

mutu = “B”

Case Is > 60

mutu = “C”

Case Is > 50

mutu = “D”

Case Is < 50

mutu = “E”

End Select

txtmutu.Text = mutu

End Sub

———————————————————————–

Private Sub Form_Load()

cbonpm.AddItem “12101691”

cbonpm.AddItem “11201692”

cbonpm.AddItem “11102693”

cbonpm.AddItem “12304694”

End Sub

——————————————————

Private Sub txtkuis_keypress(keyascii As Integer)

If keyascii = 13 Then

txttugas.SetFocus

End If

End Sub

——————————————————————

Private Sub txttugas_keypress(keyascii As Integer)

If keyascii = 13 Then

txtuts.SetFocus

End If

End Sub

————————————————————————-

 

Private Sub txtuas_keypress(keyascii As Integer)

If keyascii = 13 Then

cmdproses.SetFocus

End If

End Sub

————————————————————————-

 

Private Sub txtuts_keypress(keyascii As Integer)

If keyascii = 13 Then

txtuas.SetFocus

End If

End Sub

Font & Color Part I

Posted: 15 Februari 2013 in Tugas3

5

Private Sub chcbold_Click()

If chcbold.Value = 1 Then

lbltext.FontBold = True

Else

lbltext.FontBold = False

End If

End Sub

———————————————————————–

Private Sub chcitalic_Click()

If chcitalic.Value = 1 Then

lbltext.FontItalic = True

Else

lbltext.FontItalic = False

End If

End Sub

—————————————————————————

Private Sub chcstrikeout_Click()

If chcstrikeout.Value = 1 Then

lbltext.FontStrikethru = True

Else

lbltext.FontStrikethru = False

End If

End Sub

—————————————————————————

Private Sub chcunderline_Click()

If chcunderline.Value = 1 Then

lbltext.FontUnderline = True

Else

lbltext.FontUnderline = False

End If

End Sub

———————————————————-

Private Sub cmdreset_Click()

lbltext.ForeColor = vbBlack

optred.Value = False

optblue.Value = False

optgreen.Value = False

optyellow.Value = False

chcbold.Value = 0

chcitalic.Value = 0

chcunderline.Value = 0

chcstrikeout.Value = 0

End Sub

——————————————————

Private Sub cmdx_Click()

End

End Sub

———————————————

Private Sub optblue_Click()

lbltext.ForeColor = vbBlue

End Sub

———————————————————–

Private Sub optgreen_Click()

lbltext.ForeColor = vbGreen

End Sub

———————————————————-

Private Sub optred_Click()

lbltext.ForeColor = vbRed

End Sub

———————————————————

Private Sub optyellow_Click()

lbltext.ForeColor = vbYellow

End Sub

 

 

Aplikasi Perhitungan Gaji

Posted: 15 Februari 2013 in Tugas3

Private Sub cmdexit_Click()

End

End Sub

—————————————————————————————————

Private Sub cmdproses_Click()

Dim a, b, c As Currency

a = Val(txtpokok.Text) + Val(txttunjangan.Text) – Val(txtpotongan.Text)

b = Val(a) * 0.1

c = Val(a) – Val(b)

txtkotor.Text = a

txtpajak.Text = b

txtterima.Text = c

cmdulang.SetFocus

End Sub

————————————————————————————————

Private Sub cmdulang_Click()

txtpokok.SetFocus

txtpokok = “”

txttunjangan = “”

txtpotongan = “”

txtkotor = “”

txtpajak = “”

txtterima = “”

End Sub

——————————————————————————————-

Private Sub txtpokok_keypress(keyascii As Integer)

If keyascii = 13 Then

txttunjangan.SetFocus

End If

End Sub

————————————————————————————–

Private Sub txtpotongan_keypress(keyascii As Integer)

If keyascii = 13 Then

cmdproses.SetFocus

End If

End Sub

——————————————————————————————

Private Sub txttunjangan_keypress(keyascii As Integer)

If keyascii = 13 Then

txtpotongan.SetFocus

End If

End Sub

4

Diskon Part III

Posted: 15 Februari 2013 in Tugas3

3

Private Sub cmdexit_Click()

End

End Sub

——————————————————————————-

Private Sub cmdhitung_Click()

txtdiskon = Val(txtharga.Text) * 0.1

txtakhir = Val(txtharga.Text) – Val(txtdiskon.Text)

cmdulang.SetFocus

End Sub

—————————————————————————————–

Private Sub cmdulang_Click()

txtharga.SetFocus

txtharga = “”

txtdiskon = “”

txtakhir = “”

End Sub

————————————————————————————-

Private Sub txtharga_keypress(keyascii As Integer)

If keyascii = 13 Then

txtdiskon = Val(txtharga.Text) * 0.1

txtakhir = Val(txtharga.Text) – Val(txtdiskon.Text)

cmdhitung.SetFocus

End If

End Sub