TUGAS 5

Untitled

Private Sub Check1_Click()
Text2.FontBold = Check1.Value
End Sub

Private Sub Check2_Click()
Text2.FontItalic = Check2.Value
End Sub

Private Sub Command1_Click()
Text2.Text = Text1.Text
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Option1_Click()
Text2.ForeColor = vbBlue
End Sub

Private Sub Option2_Click()
Text2.ForeColor = vbRed
End Sub

GAMBAR1

Private Sub CmdBatal_Click()
Txtnama.SetFocus
Txtnama.Text = “”
Txtnpm.Text = “”
Txtjur.Text = “”
Txtps.Text = “”
Txttm.Text = “”
Txturut.Text = “”
End Sub

Private Sub CmdKeluar_Click()
Unload Me
End Sub

Private Sub CmdLagi_Click()
Txtnama.SetFocus
Txtnama.Text = “”
Txtnpm.Text = “”
Txtjur.Text = “”
Txtps.Text = “”
Txttm.Text = “”
Txturut.Text = “”
End Sub
Private Sub Cmdproses_Click()
Dim B As String
Txttm.Text = “20” & Left(Txtnpm.Text, 2)
B = Mid(Txtnpm.Text, 3, 1)
If B = “1” Then
Txtjurusan.Text = “Sistem Informasi”
ElseIf B = “2” Then
Txtjurusan.Text = “Manajemen Informatika”
ElseIf B = “3” Then
Txtjurusan.Text = “Tehnik Informatika”
ElseIf B = “4” Then
Txtjurusan.Text = “Manajemen & Komp. Akuntansi”
End If
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 Empat”
ElseIf B = “04” Then
Txtps.Text = “Diploma Dua”
End If
Txtnu.Text = Right(Txtnpm.Text, 3)
End Sub
Private Sub Txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnpm.SetFocus
End If
End Sub

3

Private Sub cbogolongan_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case Cbogolongan.Text
Case “I”
gapok = 1500000
tunjangan = 150000
Case “II”
gapok = 2000000
tunjangan = 200000
Case “III”
gapok = 2500000
tunjangan = 250000
Case “IV”
gapok = 3000000
tunjangan = 300000
Case Else
gapok = 0
tunjangan = 0
End Select
total = gapok + tunjangan
pajak = total * 0.1
Txtgapok.Text = gapok
TXTTUNJANGAN.Text = tunjangan
TXTPAJAK.Text = pajak
TXTTOTAL.Text = total – pajak
End Sub
Public Sub kosong()
TxtNIDN.SetFocusTxtNIDN.Text = “”
TXTNAMA.Text = “”
Cbogolongan.Text = “”
Txtgapok.Text = “”
TXTTUNJANGAN.Text = “”
TXTPAJAK.Text = “”
TXTTOTAL.Text = “”
End Sub

Private Sub txtnind_keypress(keyascii As Integer)
If keyascii = 13 Then
TXTNAMA.SetFocus
End sub

 

gbr5

Private Sub Ccmdkeluar_Click()
End
End Sub

Private Sub Cmdbatal_Click()
txtnama.SetFocus
txtnama.Text = “”
Txtmasukannilai.Text = “”
Txtgolongan.Text = “”
Txtkodestatus.Text = “”
Txtstatus.Text = “”
Txttahun.Text = “”
Txtjabatan.Text = “”
Txtbagian.Text = “”
Txtgajipokok.Text = “”
Txttunjangan.Text = “”
txttotalgaji.Text = “”
End Sub

Private Sub Cmdlagi_Click()
txtnama.SetFocus
txtnama.Text = “”
Txtmasukannilai.Text = “”
Txtgolongan.Text = “”
Txtkodestatus.Text = “”
Txtstatus.Text = “”
Txttahun.Text = “”
Txtjabatan.Text = “”
Txtbagian.Text = “”
txtgajipoko.Text = “”
Txttunjangan.Text = “”
txttotalgaji.Text = “”
End Sub

Private Sub Cmdproses_Click()
Select Case a = Mid(Txtmasukannilai.Text, 5, 1)
Case a = “A”
txtgol = “A”
Txtjabatan.Text = “MANAGER”
txtgajipoko.Text = “4000000?”
Txttunjangan.Text = “1025000?”
Case a = “B”
Txtgolongan.Text = “B”
Txtjabatan.Text = “Ka.SEKSI”
Txtgajipokok.Text = “3500000?”
Txttunjangan.Text = “975000?”
Case a = “C”
Txtgolongan.Text = “C”
Txtjabatan.Text = “STAFF”
Txtgajipokok.Text = “3000000?”
Txttunjangan.Text = “925000?”
End Select
a = Right(txtnik.Text, 3)
If a = “KEU” Then
Txtbagian.Text = “ACCOUNTING”
ElseIf a = “ADM” Then
Txtbagian.Text = “ADMINISTRASI”
ElseIf a = “SDM” Then
Txtbagian.Text = “GENERAL AFFAIR”
ElseIf a = “EDP” Then
Txtbagian.Text = “IT UNIT”
ElseIf a = “SPM” Then
Txtbagian.Text = “SECURITY”
End If
Select Case a = Mid(txtnik.Text, 7, 1)
Case a = “S”
kode = “S”
Status = “SINGEL”
Case a = “M”
kode = “M”
Status = “MENIKAH”
Case a = “J”
kode = “J”
Status = “JANDA”
Case a = “D”
kode = “D”
Status = “DUDA”
End Select
Txtkodestatus.Text = kode
Txtstatus.Text = Status
Txttahun.Text = Left(txtnik.Text, 4)
txttotalgaji.Text = Val(txtgapok.Text) + Val(Txttunjangan.Text)
End Sub

Private Sub Form_active()
txtnama.SetFocus
End Sub

Private Sub Txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtmasukannilai.SetFocus
End If
End Sub

Iklan

tugas vb4

KERETA1

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub CMDlagi_Click()

Txtkt.SetFocus

Txtkt = “”

Txtht = “”

Txtjk = “”

Txtjb = “”

Txtjt = “”

Txttotalp = “”

End Sub

 

Private Sub Cmdproses_Click()

kodetiket = Left(Txtkt.Text, 3)

If kodetiket = “BIM” Then

jeniskereta = “BIMA”

hargatiket = “50000”

jamberangkat = “16.00”

ElseIf kodetiket = “EKO” Then

jeniskereta = “EKONOMI”

hargatiket = “35000”

jamberangkat = “19.00”

ElseIf kodetiket = “MUT” Then

jeniskereta = “MUTIARA”

hargatiket = “23000”

jamberangkat = “17.00”

ElseIf kodetiket = “SEN” Then

jeniskereta = “SENJA”

hargatiket = “15000”

jamberangkat = “20.00”

End If

Txtkt.Text = kodetiket

Txtht.Text = hargatiket

Txtjk.Text = jeniskereta

Txtjb.Text = jamberangkat

Txtjt.SetFocus

End Sub

 

Private Sub Form_Activate()

Txtht.SetFocus

End Sub

 

Private Sub Txtjt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txttotalp.Text = Val(Txtht.Text) * Val(Txtjt.Text)

End If

End Sub

API