Tugas VB 3

1.

rendi1

Private Sub Cbonpm_Click()

Dim nama, jurusan, AsString

Select Case Cbonpm.Text

Case “12100527”

nama = “Rendi Saputra”

jurusan = “Sistem Informasi”

Case “12101510”

nama = “Wahyu”

jurusan = “Manajemen Informatika”

Case “12100117”

nama = “Elyana Ftriani”

jurusan = “Sistem Informasi”

Case “12101419”

nama = “Eko Mualip”

jurusan = “Manajemen Informatika”

Case “12100204”

nama = “Eko Rudiyanto”

jurusan = “Sisitem Informasi”

End Select

Txtnm.Text = nama

Txtjrs.Text = jurusan.

 

Private Sub Cbonpm_DblClick()

Private Sub form_load()

Cbonpm.AddItem “12100527”

Cbonpm.AddItem “12101510”

Cbonpm.AddItem “12100117”

Cbonpm.AddItem “12101419”

Cbonpm.AddItem “12100204”

End Sub

 

Private Sub Txtnlq_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnlt.SetFocus

End If

End Sub

 

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

 

Private Sub Cmdproses_Click()

Dim NilaiAkhir As Integer

Dim HurufMutu As String

quiz = Val(Txtnlq.Text)

tugas = Val(Txtnlt.Text)

uts = Val(Txtuts.Text)

uas = Val(Txtuas.Text)

NilaiAkhir = (quiz + tugas + uts + uas) / 4

Txtnlak.Text = NilaiAkhir

 

Select Case Txtnlak.Text

Case Is > 80

HurufMutu = “A”

Case Is > 70

HurufMutu = “B”

Case Is > 60

HurufMutu = “C”

Case Is > 50

HurufMutu = “D”

Case Is <50

HurufMutu = “E”

End Select

Txthm.Text = HurufMutu

End Sub

 

Private Sub Cmdbtl_Click()

Cbonpm.SetFocus

Cbonpm = “”

Txtnm = “”

Txtjrs = “”

Txtnlq = “”

Txtnlt = “”

Txtuts = “”

Txtuas = “”

Txtnlak = “”

Txthm = “”

End Sub

 

Private Sub Cmdklr_Click()

End

End Sub

2.

rendi2

Private Sub Optrmrh_Click()

Lblnam.ForeColor = vbRed

End Sub

 

Private Sub Opthij_Click()

Lblnam.ForeColor = vbGreen

End Sub

 

Private Sub Chktbl_Click()

Lblnam.FontBold = Chktbl.Value

End Sub

 

Private Sub Chkmrg_Click()

Lblnam.FontItalic = Chkmrg.Value

End Sub

Private Sub Cmdok_Click()

Lblnam.Caption = Txtnam.Text

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

3.

rendi3

Private Sub Txtnid_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnmp.SetFocus

End If

End Sub

 

Private Sub Cbogol_DblClick()

Private Sub form_load()

Cbogol.AddItem “I”

Cbogol.AddItem “II”

Cbogol.AddItem “III”

End Sub

 

Private Sub Cbogol_Click()

Dim Gajipokok, Pajak, Tunjangan, Gajibersih As Variant

Select Case Cbogol.Text

Case “I”

Gajipokok = 2500000

Tunjangan = 500000

Case “II”

Gajipokok = 3500000

Tunjangan = 700000

Case “III”

Gajipokok = 5000000

Tunjangan = 900000

Case Else

Gajipokok = 0

Tunjangan = 0

End Select

 

 

 

 

Gajibersih = Gajipokok + Tunjangan

Pajak = Gajibersih * 0.1

Txtgpk.Text = Gajipokok

Txttnj.Text = Tunjangan

Txtpjk.Text = Pajak

Txtgjb = Gajibersih – Pajak

 

 

Private Sub Cmdlgi_Click()

Txtnid = “”

Txtnmp = “”

Cbogol = “”

Txtgjp = “”

Txttnj = “”

Txtpjk = “”

Txtgjb = “”

End Sub

 

Private Sub Cmdbtl_Click()

Txtnid = “”

Txtnmp = “”

Cbogol = “”

Txtgjp = “”

Txttnj = “”

Txtpjk = “”

Txtgjb = “”

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

4.

rendi4

Private Sub Txtnam_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnpm.SetFocus

End If

End Sub

 

Private Sub Cmdproses_Click()

Dim St As String

Txtthm.Text = “20” & Left(Txtnpm.Text, 2)

PS = Mid(Txtnpm.Text, 3, 1)

If PS = “1” Then

Txtjrs.Text = “Sistem Informasi”

ElseIf PS = “2” Then

Txtjrs.Text = “Manajemen Informasi”

ElseIf PS = “3” Then

Txtjrs.Text = “Komputer Manajemen Akuntansi”

ElseIf PS = “4” Then

Txtjrs.Text = “Tehnik Informatika”

End If

PS= Mid(Txtnpm.Text, 4, 2)

If PS = “00” Then

Txtpst.Text = “Strata Satu”

ElseIf PS = “01” Then

Txtpst.Text = “Diploma Tiga ”

ElseIf PS = “02” Then

Txtpst.Text = “Diploma Dua”

ElseIf PS = “03” Then

Txtpst.Text = “Diploma Satu”

End If

PS = Right(Txtnpm.Text, 3)

Txtnour.Text = Right(Txtnpm.Text, 3)

End Sub

 

Private Sub Cmdlagi_Click()

Txtnam.SetFocus

Txtnam = “”

Txtnpm = “”

Txtjrs = “”

Txtpst = “”

Txtthm = “”

Txtnour = “”

End Sub

 

Private Sub Cmdbatal_Click()

Txtnam.SetFocus

Txtnam = “”

Txtnpm = “”

Txtjrs = “”

Txtpst = “”

Txtthm = “”

Txtnour = “”

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s