Tugas VB 5

tika

Private Sub Txtnama_keypress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnpm.SetFocus

End If

End Sub

 

Private Sub Cmdpros_Click()

Dim M As String

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

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

If J = “1” Then

Jur = “Sistem Informasi”

ElseIf J = “2” Then

Jur = “Manajemen Informatika”

ElseIf J = “3” Then

Jur = “Tehnik Informatika”

ElseIf J = “4” Then

Jur = “Manajemen & Komp.Akuntansi”

End If

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

If S = “01” Then

Prost = “Strata Satu”

ElseIf S = “02” Then

Prost = “Diploma Empat”

ElseIf S = “03” Then

Prost = “Diploma Tiga”

ElseIf S = “04” Then

Prost = “Diploma Dua”

End If

No = Right(Txtnpm.Text, 3)

Txtjur.Text = Jur

Txtprost.Text = Prost

Txtno.Text = No

End Sub

 

Private Sub Cmdsave_Click()

Data1.Recordset.Update

End Sub

 

Private Sub Cmdcancel_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub Cmdexit_Click()

Unload Me

End Sub

 

Private Sub Cmdnew_Click()

Data1.Recordset.AddNew

Txtnpm.SetFocus

End Sub

By tika1390

TUGAS QUIS 4

Ane hari ini dikasih tugas ama dosen tuk nyelesain soal2 quis minggu kmren,, oke ayo kita kerjain….

  • Buka aplikasi visual basic
  • Buat forem sperti berikut

Image

  • Pada command proses, masukkan kode seperti berikut

Private Sub Command1_Click()

Dim JB, PN, PB As String

Dim H As Currency

Text4.Text = “20” & Right(Combo1, 2)

A = Mid(Combo1, 3, 3)

If A = “SIM” Then

JB = “Sistem Informasi Manajemen”

PN = “Yati Nur Oktavia”

H = “75900”

ElseIf A = “EDP” Then

JB = “Elektronik Data Processing”

PN = “Imam Tarmizi”

H = “62000”

ElseIf A = “MNJ” Then

JB = “Manajemen”

PN = “Valentina Mariana Adiwianti”

H = “42000”

ElseIf A = “CDR” Then

JB = “Corel Draw”

PN = “Rian Suhandi”

H = “53000”

ElseIf A = “RPL” Then

JB = “Rekayasa Perangkat Lunak”

PN = “Sinta Umpu Singa”

H = “83000”

End If

Text2.Text = JB

Text3.Text = PN

Text6.Text = H

B = Left(Combo1, 1)

If B = “A” Then

Text5.Text = “Andi offset Yogyakarta”

ElseIf B = “I” Then

Text5.Text = “Indah Surabaya”

ElseIf B = “S” Then

Text5.Text = “Salemba Empat”

ElseIf B = “E” Then

Text5.Text = “Elek Media Komputindo”

ElseIf B = “M” Then

Text5.Text = “Maxicom”

End If

End Sub

 

  • Selesai. Untuk command2 yg lain,, agan2 pasti dah ngerti donk…
  • Ni hasilnya….

 

 

 

 

 

 

By tika1390

TUGAS QUIS 3

Ane hari ini dikasih tugas ama dosen tuk nyelesain soal2 quis minggu kmren,, oke ayo kita kerjain….

  • Buka aplikasi visual basic
  • Buat forem sperti berikut

Image

  • Pada command proses, masukkan kode seperti berikut

Private Sub Command1_Click()

Dim JBT, BG As String

Dim GP, TJ, TG As Currency

Text4.Text = Left(Text11.Text, 4)

G = Mid(Text11.Text, 5, 1)

If G = “A” Then

G = “A”

JBT = “Manajer”

GP = “4000000”

TJ = “1025000”

ElseIf G = “B” Then

G = “B”

JBT = “Ka. Seksi”

GP = “3500000”

TJ = “975000”

ElseIf G = “C” Then

G = “C”

JBT = “Staff”

GP = “3000000”

TJ = “925000”

End If

Text10.Text = G

Text5.Text = JBT

Text7.Text = GP

Text8.Text = TJ

KS = Mid(Text11.Text, 7, 1)

If KS = “S” Then

KS = “S”

Stat = “Single”

ElseIf KS = “M” Then

KS = “M”

Stat = “Menikah”

ElseIf KS = “J” Then

KS = “J”

Stat = “Janda”

ElseIf KS = “D” Then

KS = “D”

Stat = “Duda”

End If

Text2.Text = KS

Text3.Text = Stat

B = Right(Text11.Text, 3)

If B = “KEU” Then

Text6.Text = “Accounting”

ElseIf B = “ADM” Then

Text6.Text = “Administrasi”

ElseIf B = “SDM” Then

Text6.Text = “General Affair”

ElseIf B = “EDP” Then

Text6.Text = “IT Unit”

ElseIf B = “SPM” Then

Text6.Text = “Security”

End If

Text9.Text = Val(Text7.Text) + Val(Text8.Text)

End Sub

 

  • Selesai. Untuk command2 yg lain,, agan2 pasti dah ngerti donk…
  • Ni hasilnya….

 

 

 

 Image

By tika1390

TUGAS QUIS 2

Ane hari ini dikasih tugas ama dosen tuk nyelesain soal2 quis minggu kmren,, oke ayo kita kerjain….

  • Buka aplikasi visual basic
  • Buat forem sperti berikut

Image

  • Pada command proses, masukkan kode seperti berikut

Private Sub Command1_Click()

Dim JB, PN, PB As String

Dim H As Currency

Text4.Text = “20” & Mid(Text1.Text, 5, 2)

A = Left(Text1.Text, 3)

If A = “SIM” Then

JB = “Sistem Informasi Manajemen”

PN = “Fadiya Ulfa”

H = “75900”

ElseIf A = “EDP” Then

JB = “Elektronik Data Processing”

PN = “Nurul Agustina”

H = “62000”

ElseIf A = “MNJ” Then

JB = “Manajemen”

PN = “Rian Hidayat”

H = “42000”

ElseIf A = “CDR” Then

JB = “Corel Draw”

PN = “Siti Nur Khotimah”

H = “53000”

ElseIf A = “RPL” Then

JB = “Rekayasa Perangkat Lunak”

PN = “Winda Erlianti”

H = “83000”

End If

Text2.Text = JB

Text3.Text = PN

Text6.Text = H

B = Right(Text1.Text, 1)

If B = “A” Then

Text5.Text = “Andi offset Yogyakarta”

ElseIf B = “I” Then

Text5.Text = “Indah Surabaya”

ElseIf B = “S” Then

Text5.Text = “Salemba Empat”

ElseIf B = “E” Then

Text5.Text = “Elek Media Komputindo”

ElseIf B = “M” Then

Text5.Text = “Maxicom”

End If

End Sub

 

  • Selesai. Untuk command2 yg lain,, agan2 pasti dah ngerti donk…
  • Ni hasilnya….

 

 Image

By tika1390

TUGAS QUIS 1

Ane hari ini dikasih tugas ama dosen tuk nyelesain soal2 quis minggu kmren,, oke ayo kita kerjain….

  • Buka aplikasi visual basic
  • Buat forem sperti berikut

Image

  • Pada command proses, masukkan kode seperti berikut

Private Sub Command1_Click()

Dim JB, PN, PB As String

Dim H As Currency

Text4.Text = “20” & Right(Text1.Text, 2)

A = Mid(Text1.Text, 3, 3)

If A = “SIM” Then

JB = “Sistem Informasi Manajemen”

PN = “Andra setiawan”

H = “75900”

ElseIf A = “EDP” Then

JB = “Elektronik Data Processing”

PN = “Desi Istiqomah”

H = “62000”

ElseIf A = “MNJ” Then

JB = “Manajemen”

PN = “Sandi fitrajaya”

H = “42000”

ElseIf A = “CDR” Then

JB = “Corel Draw”

PN = “Ernita Sari”

H = “53000”

ElseIf A = “RPL” Then

JB = “Rekayasa Perangkat Lunak”

PN = “Winda Erlianti”

H = “83000”

End If

Text2.Text = JB

Text3.Text = PN

Text6.Text = H

B = Left(Text1.Text, 1)

If B = “A” Then

Text5.Text = “Andi offset Yogyakarta”

ElseIf B = “I” Then

Text5.Text = “Indah Surabaya”

ElseIf B = “S” Then

Text5.Text = “Salemba Empat”

ElseIf B = “E” Then

Text5.Text = “Elek Media Komputindo”

ElseIf B = “M” Then

Text5.Text = “Maxicom”

End If

End Sub

  • Selesai. Untuk command2 yg lain,, agan2 pasti dah ngerti donk…
  • Ni hasilnya….
  • Image
By tika1390

Tugas Visual Basic 3

1.

Tika1

Private Sub Cbonpm_Click()

Dim nama, jurusan, AsString

Select Case Cbonpm.Text

Case “12100365”

nama = “Yustika”

jurusan = “SistemI nformasi”

Case “12100211”

nama = “Priyono”

jurusan = “Manajemen Informatika”

Case “12100217”

nama = “DidiSumantri”

jurusan = “Tehnik Informatika”

Case “12100112”

nama = “EkoRudiyanto”

jurusan = “Manajemen Informatika”

Case “12100413”

nama = “Indri Susanti”

jurusan = “Sisitem Informasi”

End Select

Txtnm.Text = nama

Txtjur.Text = jurusan.

 

Private Sub Cbogol_DblClick()

Private Sub form_load()

Cbonpm.AddItem “12100365”

Cbonpm.AddItem “12100211”

Cbonpm.AddItem “2100217”

Cbonpm.AddItem “12100112”

Cbonpm.AddItem “12100413”

End Sub

 

Private Sub Txtquiz_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 Txtuts_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtuas.SetFocus

End If

End Sub

 

Private Sub Cmdpros_Click()

Dim NilaiAkhirAs Integer

Dim HurufMutuAs String

quiz = Val(Txtquiz.Text)

tugas = Val(Txttugas.Text)

uts = Val(Txtuts.Text)

uas = Val(Txtuas.Text)

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

Txtnilak.Text = NilaiAkhir

 

Select Case Txtnilak.Text

Case Is > 80

HurufMutu = “A”

Case Is > 70

HurufMutu = “B”

Case Is > 60

HurufMutu = “C”

Case Is > 50

HurufMutu = “D”

Case Is > 40

HurufMutu = “E”

End Select

Txthrm.Text = HurufMutu

End Sub

 

Private Sub Cmdbtl_Click()

Cbonpm.SetFocus

Cbonpm = “”

Txtnm = “”

Txtjur = “”

Txtquiz = “”

Txttugas = “”

Txtuts = “”

Txtuas = “”

Txtnilak = “”

Txthrm = “”

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

2.

Tika2

Private Sub Opthij_Click()

Lblnm.ForeColor = vbGreen

End Sub

 

Private Sub Optmrh_Click()

Lblnm.ForeColor = vbRed

End Sub

Private Sub Chktbl_Click()

Lblnm.FontBold = Chktbl.Value

End Sub

 

Private Sub Chkmrg_Click()

Lblnm.FontItalic = Chkmrg.Value

End Sub

Private Sub Cmdok_Click()

Lblnm.Caption = Txtnm.Text

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

3.

tika3

Private Sub Txtnidn_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnpg.SetFocus

End If

End Sub

 

Private Sub Cbogol_DblClick()

Private Sub form_load()

Cbogol.AddItem “I”

Cbogol.AddItem “II”

Cbogol.AddItem “III”

Cbogol.AddItem “IV”

End Sub

 

Private Sub Cbogol_Click()

Dim Gajipokok, Pajak, Tunjangan, GajibersihAs Variant

Select Case Cbogol.Text

Case “I”

Gajipokok = 2500000

Tunjangan = 100000

Case “II”

Gajipokok = 3000000

Tunjangan = 200000

Case “III”

Gajipokok = 3500000

Tunjangan = 300000

Case “IV”

Gajipokok = 4000000

Tunjangan = 400000

Case Else

Gajipokok = 0

Tunjangan = 0

End Select

Gajibersih = Gajipokok + Tunjangan

Pajak = Gajibersih * 0.1

Txtgjp.Text = Gajipokok

Txttun.Text = Tunjangan

Txtpjk.Text = Pajak

Txtgjt = Gajibersih – Pajak

 

 

Private Sub Cmdlg_Click()

Txtnidn = “”

Txtnpg = “”

Cbogol = “”

Txtgjp = “”

Txttun = “”

Txtpjk = “”

Txtgjt = “”

End Sub

 

Private Sub Cmdbtl_Click()

Txtnidn = “”

Txtnpg = “”

Cbogol = “”

Txtgjp = “”

Txttun = “”

Txtpjk = “”

Txtgjt = “”

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

4.

Tika4

Private Sub Txtnama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnpm.SetFocus

End If

End Sub

 

Private Sub Cmdproses_Click()

Dim SAs String

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

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

If S = “1” Then

Txtjur.Text = “SisitemInformasi”

ElseIf S = “2” Then

Txtjur.Text = “ManajemenInformaitika”

ElseIf S = “3” Then

Txtjur.Text = “TehnikInformatika”

ElseIf S = “4” Then

Txtjur.Text = “KomputerAkuntansi”

End If

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

If S = “00” Then

Txtpst.Text = “Strata Satu”

ElseIf S = “01” Then

Txtpst.Text = “Diploma Dua”

ElseIf S = “02” Then

Txtpst.Text = “Diploma Tiga”

ElseIf S = “03” Then

Txtpst.Text = “Diploma Satu”

End If

S = Right(Txtnpm.Text, 3)

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

End Sub

 

Private Sub Cmdlgi_Click()

Txtnama.SetFocus

Txtnama = “”

Txtnpm = “”

Txtjur = “”

Txtpst = “”

Txtthnm = “”

Txtno = “”

End Sub

 

Private Sub Cmdbtl_Click()

Txtnama.SetFocus

Txtnama = “”

Txtnpm = “”

Txtjur = “”

Txtpst = “”

Txtthnm = “”

Txtno = “”

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

By tika1390

Tugas Pertemuan 2 VB

1.

didi5

Private Sub Txtbl1_Change()

If KeyAscii = 13 Then

Txtbl2.SetFocus

End If

End Sub

 

Private Sub Cmdbagi_Click()

Txtjml.Text = Val(Txtbl1.Text) / Val(Txtbl2)

End Sub

 

Private Sub Cmdkali_Click()

Txtjml.Text = Val(Txtbl1.Text) * Val(Txtbl2)

End Sub

 

 

Private Sub Cmdtmbh_Click()

Txtjml.Text = Val(Txtbl1.Text) + Val(Txtbl2.Text)

End Sub

 

Private Sub Cmdmin_Click()

Txtjml.Text = Val(Txtbl1.Text) – Val(Txtbl2.Text)

End Sub

 

Private Sub Cmdlagi_Click()

Txtbl1 = “”

Txtbl2 = “”

Txtjml = “”

End Sub

 

Private Sub Cmdklwr_Click()

End

End Sub

2.

desi1

Private Sub txtn1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtn2.SetFocus

End If

End Sub

 

Private Sub txtn2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtn3.SetFocus

End If

End Sub

 

Private Sub Txtn3_KeyPress(KeyAscii As Integer)

Txtn3.Text = Val(txtn1.Text) * Val(txtn2.Text)

End Sub

 

Private Sub Cmdhit_Click()

Txtn3.Text = Val(txtn1.Text) * Val(txtn2.Text)

End Sub

 

Private Sub Cmdbrsh_Click()

Txtn1 = “”

Txtn2 = “”

Txtn3 = ”

End Sub

 

Private Sub Cmdklwr_Click()

End

End Sub

3.

Am2

Private Sub opthij_Click()

Lbljd.ForeColor = vbGreen

End Sub

 

Private Sub optbir_Click()

Lbljd.ForeColor = vbBlue

End Sub

 

Private Sub optmrh_Click()

Lbljd.ForeColor = vbRed

End Sub

 

Private Sub Optkng_Click()

Lbljd.ForeColor = vbYellow

End Sub

 

 

Private Sub Chkita_Click()

If Chkita.Value = 1 Then

Lbljd.FontItalic = True

Else

Lbljd.FontItalic = False

End If

End Sub

 

Private Sub Chkbld_Click()

If Chkbld.Value = 1 Then

Lbljd.FontBold = True

Else

Lbljd.FontBold = False

End If

End Sub

 

Private Sub Chkund_Click()

If Chkund.Value = 1 Then

Lbljd.FontUnderline = True

Else

Lbljd.FontUnderline = False

End If

End Sub

 

Private Sub Chkstrk_Click()

If Chkstkr.Value = 1 Then

Lbljd.FontStrikethru = True

Else

Lbljd.FontStrikethru = False

End If

End Sub

 

Private Sub Cmdout_Click()

End

End Sub

4.

tik3

Private Sub Txtgpk_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txttjg.SetFocus

End If

End Sub

 

Private Sub Txttjg_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtptng.SetFocus

End If

End Sub

 

 

Private Sub Cmdpros_Click()

Txtgjk.Text = Val(Txtgpk.Text) + Val(Txttjg.Text) – Val(Txtptng.Text)

Txtpjk.Text = Val(Txtgjk.Text) * 0.1

Txtgjbr.Text = Val(Txtgjk.Text) – Val(Txtpjk.Text)

End Sub

 

Private Sub Cmdlg_Click()

Txtgpk = “”

Txttjg = “”

Txtptng = “”

Txtgjk = “”

Txtpjk = “”

Txtgjbr= “”

End Sub

 

Private Sub Cmdexit_Click()

End

End Sub

5.

tik4

Private Sub Cmdhit_Click()

Txtdskn.Text = Val(Txth1.Text) * 0.1

Txth2.Text = Val(Txth1.Text) – Val(Txtdskn.Text)

End Sub

 

Private Sub Cmdlagi_Click()

Txth1 = “”

Txtdskn = “”

Txth2 = “”

End Sub

 

Private Sub Cmdklwr_Click()

End

End Sub

 

By tika1390