TUGAS NPM DATA BASE

Gambar

Private Sub cmdsimpan_Click()

Data1.Recordset.Update

End Sub

Private Sub Command1_Click()

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

If kode = “1″ Then

txtjur.Text = “Sistem Informasi”

ElseIf kode = “2″ Then

txtjur.Text = “Manajemen Informatika”

ElseIf kode = “3″ Then

txtjur.Text = “Tehnik Informatika”

End If

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

If kode = “01″ Then

txtprodi.Text = “Strata Satu”

ElseIf kode = “02″ Then

txtprodi.Text = “Diploma Empat”

ElseIf kode = “03″ Then

txtprodi.Text = “Diploma Tiga”

End If

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

txttm.Text = “20″ & Left(txtnpm.Text, 2)

End Sub

Private Sub Command2_Click()

Data1.Recordset.AddNew

txtnpm.SetFocus

End Sub

Private Sub Command4_Click()

Data1.Recordset.Delete

End Sub

Private Sub Command5_Click()

End

End Sub

Advertisements

tugas vb 5 penghitungan gaji

Gambar

Private Sub Command1_Click()
    Text4.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)
    Text5.Text = Val(Text4.Text) * 0.1
    Text6.Text = Val(Text4.Text) – Val(Text5.Text)
End Sub

Private Sub Command2_Click()
    Text1.SetFocus
    Text1 = “”
    Text2 = “”
    Text3 = “”
    Text4 = “”
    Text5 = “”
    Text6 = “”
    
End Sub

Private Sub Command3_Click()
    Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    Text2.SetFocus
End If

End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    Text3.SetFocus
End If

End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    Text4.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)
    Text5.Text = Val(Text4.Text) * 0.1
    Text6.Text = Val(Text4.Text) – Val(Text5.Text)
End If
End Sub

TUGAS 9 GOLONGAN

Gambar

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

 

Private Sub Cmdbatal_Click()

kosong

 

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

 

End Sub

 

Private Sub Cmdlagi_Click()

kosong

 

End Sub

 

Public Sub kosong()

Txtnind.SetFocus

Txtnind.Text = “”

Txtnama.Text = “”

cbogolongan.Text = “”

txtgapok.Text = “”

Txttunjangan.Text = “”

Txtpajak.Text = “”

Txttotal.Text = “”

End Sub

 

Private Sub Form_Load()

cbogolongan.AddItem “I”

cbogolongan.AddItem “II”

cbogolongan.AddItem “III”

cbogolongan.AddItem “IV”

End Sub

 

Private Sub Txtnind_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnama.SetFocus

End If

 

End Sub

TUGAS 8 NAMA DAN NPM

Gambar

Private Sub cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

txtnpm.Text = “”

Txtjur.Text = “”

Txtps.Text = “”

Txttm.Text = “”

Txtnu.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 = “”

Txtnu.Text = “”

End Sub

 

Private Sub cmdproses_Click()

  

Dim S As String

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

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

If S = “1” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “2” Then

Txtjur.Text = “Manajemen Informatika”

ElseIf S = “3” Then

Txtjur.Text = “Tehnik Informatika”

ElseIf S = “4” Then

Txtjur.Text = “Manajemen & Komp. Akuntansi”

End If

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

If S = “01” Then

Txtps.Text = “Strata Satu”

ElseIf S = “02” Then

Txtps.Text = “Diploma Tiga”

ElseIf S = “03” Then

Txtps.Text = “Diploma Empat”

ElseIf S = “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

TUGAS 7 TULISKAN NAMA

Gambar

Private Sub Check1_Click()

    Label2.FontBold = Check1.Value

 

End Sub

 

Private Sub Check2_Click()

Label2.FontItalic = Check2.Value

End Sub

 

Private Sub Command1_Click()

Label2.Caption = Text1.Text

End Sub

 

Private Sub Command2_Click()

    End

 

End Sub

 

Private Sub Option1_Click()

Label2.ForeColor = vbBlue

End Sub

 

Private Sub Option2_Click()

Label2.ForeColor = vbRed

End Sub

 

Private Sub Text1_Change()

 

End Sub

tugas 6 HURUP MUTU

Gambar

 

Private Sub cbonpm_Click()

    Dim NM, JR As String

    Select Case cbonpm.Text

    Case “12100193”

    NM = “Didi Herdiansyah”

    JR = “Sistem Informasi”

    Case “12201019”

    NM = “Darwin Saputra”

    JR = “Manajemen Informatika”

    Case “12100187”

    NM = “Hasan Alarifi”

    JR = “Sistem Informasi”

    Case “12201076”

    NM = “Ahmad Tohir”

    JR = “Manajemen Informatika”

    Case “12201092”

    NM = “Yohanes Krisnawan”

End Select

    Txtnama.Text = NM

    Txtjurusan.Text = JR

    Txtquis.SetFocus

End Sub

 

 

Private Sub Cmdbatal_Click()

    cbonpm.SetFocus

    cbonpm.Text = “”

    Txtnama.Text = “”

    Txtjurusan.Text = “”

    Txtquis.Text = “”

    Txttugas.Text = “”

    Txtuts.Text = “”

    Txtuas.Text = “”

    Txtna.Text = “”

    txthm.Text = “”

   

End Sub

 

Private Sub Cmdkeluar_Click()

 Unload Me

End Sub

 

Private Sub Cmdproses_Click()

    Dim NA As Integer

Dim HM As String

QUIS = Val(Txtquis.Text)

TUGAS = Val(Txttugas.Text)

UTS = Val(Txtuts.Text)

UAS = Val(Txtuas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

Txtna.Text = NA

 

Select Case Txtna.Text

 Case Is > 80

 HM = “A”

 Case Is > 70

 HM = “B”

 Case Is > 60

 HM = “C”

 Case Is > 50

 HM = “D”

 Case Is < 50

 HM = “E”

  End Select

  txthm.Text = HM

End Sub

 

Private Sub Form_Load()

cbonpm.AddItem “12100193”

cbonpm.AddItem “12201019”

cbonpm.AddItem “12100187”

cbonpm.AddItem “12201076”

cbonpm.AddItem “12201092”

End Sub

 

 

Private Sub Txtnama_Change()

 

End Sub

 

Private Sub Txtquis_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

    Dim NA As Integer

Dim HM As String

QUIS = Val(Txtquis.Text)

TUGAS = Val(Txttugas.Text)

UTS = Val(Txtuts.Text)

UAS = Val(Txtuas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

Txtna.Text = NA

 

Select Case Txtna.Text

 Case Is > 80

 HM = “A”

 Case Is > 70

 HM = “B”

 Case Is > 60

 HM = “C”

 Case Is > 50

 HM = “D”

 Case Is < 50

 HM = “E”

  End Select

  txthm.Text = HM

  End If

End Sub

 

 

Private Sub Txtuts_KeyPress(KeyAscii As Integer)

    If KeyAscii = 13 Then

    Txtuas.SetFocus

End If

End Sub

tugas 4.microsofvisual basic

Gambar

 

Private Sub Chkbold_Click()

‘membuat teks tebal

If Chkbold.Value = 1 Then

IBITeks.FontBold = True

Else

IBITeks.FontBold = False

End If

 

 

End Sub

 

Private Sub Chkitalic_Click()

‘membuat teks miring

If Chkitalic.Value = 1 Then

IBITeks.FontItalic = True

Else

IBITeks.FontItalic = False

End If

End Sub

 

Private Sub Chkstrike_Click()

‘membuat teks bergaris tengah

If Chkstrike.Value = 1 Then

IBITeks.FontStrikethru = True

Else

IBITeks.FontStrikethru = False

End If

End Sub

 

Private Sub Chkunder_Click()

‘membuat teks garis bawah

If Chkunder.Value = 1 Then

IBITeks.FontUnderline = True

Else

IBITeks.FontUnderline = False

End If

End Sub

 

Private Sub Cmdexit_Click()

Unload Me

End Sub

 

Private Sub Optblue_Click()

‘membuat teks berwarna biru

IBITeks.ForeColor = vbBlue

End Sub

 

Private Sub Optgreen_Click()

‘membuat teks berwarna hijau

IBITeks.ForeColor = vbGreen

End Sub

 

Private Sub Optred_Click()

‘membuat teks berwarna merah

IBITeks.ForeColor = vbRed

 

End Sub

 

Private Sub OptYellow_Click()

‘membuat teks berwarna kuning

IBITeks.ForeColor = vbYellow

End Sub

tugas 3 diskon

Gambar

Private Sub Command1_Click()
Text2.Text = Val(Text1.Text) * 0.1
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”

End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.Text = Val(Text1.Text) * 0.1
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End If
End Sub

tugas 2 kalkulator mini

Gambar

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text4.Text = Val(Text1.Text) * Val(Text2.Text)
Text5.Text = Val(Text1.Text) – Val(Text2.Text)
Text6.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”

End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text4.Text = Val(Text1.Text) * Val(Text2.Text)
Text5.Text = Val(Text1.Text) – Val(Text2.Text)
Text6.Text = Val(Text1.Text) / Val(Text2.Text)
End If
End Sub