TUGAS VB PERKALIAN

18 Feb

PERKALIAN

Private Sub cmndbrsih_Click()
txt1.SetFocus
txt1 = “”
txt2 = “”
txthsil = “”

End Sub

Private Sub Cmndhtung_Click()
Dim A As Single
Dim B As Single
A = txt1.Text
B = txt2.Text
hasil = A * B
txthsil.Text = hasil

End Sub

Private Sub cmndkluar_Click()
End
End Sub

Private Sub txt1_Change()

End Sub

Iklan

TUGAS VB APLIKASI PROSES

18 Feb

APLIKASI PROSES

Private Sub cekmring_Click()
lbl2.FontItalic = cekmring.Value
End Sub

Private Sub cektbal_Click()
lbl2.FontBold = cektbal.Value
End Sub

Private Sub cmndok_Click()
lbl2.Caption = txt1.Text
End Sub

Private Sub cmndslsai_Click()
End
End Sub

Private Sub optbiru_Click()
lbl2.ForeColor = vbBlue
End Sub

Private Sub optmrah_Click()
lbl2.ForeColor = vbRed
End Sub

Private Sub txt1_Change()

End Sub

TUGAS VB TULISKAN

18 Feb

TULISKAN

Private Sub cekmring_Click()
lbl2.FontItalic = cekmring.Value
End Sub

Private Sub cektbal_Click()
lbl2.FontBold = cektbal.Value
End Sub

Private Sub cmndok_Click()
lbl2.Caption = txt1.Text
End Sub

Private Sub cmndslsai_Click()
End
End Sub

Private Sub optbiru_Click()
lbl2.ForeColor = vbBlue
End Sub

Private Sub optmrah_Click()
lbl2.ForeColor = vbRed
End Sub

Private Sub txt1_Change()

End Sub

TUGAS VB MUTU HURUF

18 Feb

HURUF MUTU

Private Sub cmbonpm_Click()
Dim nama, jurusan, HM As String
Select Case cmbonpm.Text
Case “1234”
nama = “WIDIA”
jurusan = “SISTEM INFORMASI”
Case “3456”
nama = “NOVITA”
jurusan = “MANAJEMEN INFORMATIKA”
Case “5678”
nama = “ROSIDA”
jurusan = “KOMPUTER AKUNTANSI”
End Select
txtnama = nama
txtjrus = jurusan
txtquis.SetFocus
End Sub

Private Sub cmndbtl_Click()
cmbonpm.SetFocus
cmbonpm = “”
txtnama = “”
txtjrus = “”
txtquis = “”
txttgas = “”
txtuts = “”
txtuas = “”
txtakhir = “”
End Sub

Private Sub cmndkluar_Click()
Unload Me
End Sub

Private Sub cmndproses_Click()
Dim NA As Integer
Dim HM As String
QUIS = Val(txtquis.Text)
TUGAS = Val(txttgas.Text)
UTS = Val(txtuts.Text)
UAS = Val(txtuas.Text)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtakhir.Text = NA
Select Case txtakhir.Text
Case Is > 95
HM = “A”
Case Is > 80
HM = “B”
Case Is > 70
HM = “C”
Case Is > 60
HM = “D”
Case Is > 50
HM = “E”
End Select
txthm.Text = HM
End Sub

Private Sub Form_Load()
cmbonpm.AddItem “1234”
cmbonpm.AddItem “3456”
cmbonpm.AddItem “5678”
End Sub
Private Sub txtquis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttgas.SetFocus
End If
End Sub
Private Sub txttgas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtuts.SetFocus
End If
End Sub
Private Sub txtuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtuas.SetFocus
End If
End Sub

TUGAS VB NPM

18 Feb

NPM

Private Sub cmndbtl_Click()
txtnama.SetFocus
txtnama.Text = “”
txtnpm.Text = “”
txtjurus.Text = “”
txtps.Text = “”
txttm.Text = “”
txtno.Text = “”
End Sub

Private Sub cmndkluar_Click()
Unload Me
End Sub

Private Sub cmndlgi_Click()
txtnama.SetFocus
txtnama.Text = “”
txtnpm.Text = “”
txtjurus.Text = “”
txtps.Text = “”
txttm.Text = “”
txtno.Text = “”
End Sub

Private Sub cmndproses_Click()
Dim S As String
txttm.Text = “20” & Left(txtnpm.Text, 2)
S = Mid(txtnpm.Text, 3, 1)
If S = “1” Then
txtjurus.Text = “SISTEM INFORMASI”
ElseIf S = “2” Then
txtjurus.Text = “MANAJEMEN INFORMATIKA”
ElseIf S = “3” Then
txtjurus.Text = “TEKNIK INFORMASI”
ElseIf S = “4” Then
txtjurus.Text = “KOMPUTER AKUNTANSI”
End If
S = Mid(txtnpm.Text, 4, 2)
If S = “01” Then
txtps.Text = “STRATA SATU”
ElseIf S = “02” Then
txtps.Text = “DIPLOMA EMPAT”
ElseIf S = “03” Then
txtps.Text = “DIPLOMA TIGA”
ElseIf S = “04” Then
txtps.Text = “DIPLOMA DUA”
End If
txtno.Text = Right(txtnpm.Text, 3)
End Sub
Private Sub Form_Activate()
txtnama.SetFocus
txtnama.Text = “”
txtnpm.Text = “”
txtjurus.Text = “”
txtps.Text = “”
txttm.Text = “”
txtno.Text = “”
End Sub
Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnpm.SetFocus
End If
End Sub

TUGAS VB FONT COLOUR&STYLE

18 Feb

FONT COLOUR&STYLE

Private Sub cekbold_Click()
If cekbold.Value = 1 Then
lbltxt.FontBold = True
Else
lbltxt.FontBold = False
End If
End Sub
Private Sub cekitalic_Click()
If cekitalic.Value = 1 Then
lbltxt.FontItalic = True
Else
lbltxt.FontItalic = False
End If
End Sub

Private Sub cekstrike_Click()
If cekunder.Value = 1 Then
lbltxt.FontStrikethru = True
Else
lbltxt.FontStrikethru = False
End If
End Sub
Private Sub cekunder_Click()
If cekunder.Value = 1 Then
lbltxt.FontUnderline = True
Else
lbltxt.FontUnderline = False
End If
End Sub
Private Sub cmndexit_Click()
End
End Sub

Private Sub opblue_Click()
lbltxt.ForeColor = vbBlue
End Sub
Private Sub opgreen_Click()
lbltxt.ForeColor = vbGreen
End Sub
Private Sub opred_Click()
lbltxt.ForeColor = vbRed
End Sub
Private Sub opyellow_Click()
lbltxt.ForeColor = vbYellow
End Sub

TUGAS VB NIDN

18 Feb

NIDN PEGAWAI

Private Sub cmbogolong_CLICK()
Dim GAJI, PAJAK, TUNJANGAN, TOTAL As Variant
Select Case cmbogolong.Text
Case “I”
GAJI = 1650000
TUNJANGAN = 1500000
Case “II”
GAJI = 2250000
TUNJANGAN = 1700000
Case “III”
GAJI = 2500000
TUNJANGAN = 1950000
Case Else
GAJI = 0
TUNJANGAN = 0
End Select
TOTAL = GAJI + TUNJANGAN
PAJAK = TOTAL * 0.1
txtgp.Text = GAJI
txttj.Text = TUNJANGAN
txtpjk.Text = PAJAK
txtterima = TOTAL – PAJAK
End Sub
Private Sub cmndbtl_Click()
kosong
End Sub

Private Sub cmndkluar_Click()
Unload Me
End Sub

Private Sub cmndlgi_Click()
kosong
End Sub
Private Sub Form_Load()
cmbogolong.AddItem “I”
cmbogolong.AddItem “II”
cmbogolong.AddItem “III”
End Sub

Public Sub kosong()
txtnidn.SetFocus
txtnidn.Text = “”
txtnama.Text = “”
cmbogolong.Text = “”
txtgp.Text = “”
txttj.Text = “”
txtpjk.Text = “”
txtterima.Text = “”
End Sub
Private Sub txtnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub