TUGAS VB

VB PRILI

Private Sub CMDPROSES_Click()
Dim snpm As String
snpm = InputBox(“npm:”)
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find “npm =” & snpm & “”
End Sub

Private Sub CMDUPDATE_Click()
Text1.SetFocus
Adodc1.Recordset.AddNew
End Sub

Private SubCMDSAVE_Click()

Adodc1.Recordset.Update
MsgBox “data berhasil disimpan. . . ! ! !”, vbOKOnly + vbInformation, “konfirmasi”
End Sub

Private Sub CMDDELETE_Click()
If MsgBox(“apakah anda yakin ingin menghapusnya. . . ???”, vbokancel + vbCritical, “konfirmasi”) = vbOK Then
Adodc1.Recordset.Delete
End Sub

Private Sub CMDEXIT_Click()
End
End Sub

Private Sub Form_Activate()

Txtnama.setfocus
Txtnama1.Text = “”
Txtnpm.Text = “”
Txtjrs.Text = “”
Txtps.Text = “”
Txttm.Text = “”
Txtnu.Text = “”
End Sub

Advertisements
By priliantinovitasari

tugas VB : No. 8

grderf

Private Sub cmdbatal_Click()
cbo.SetFocus
cbo.Text = “”
txta.Text = “”
txtb.Text = “”
txtc.Text = “”
txtd.Text = “”
txte.Text = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
cbo.SetFocus
cbo.Text = “”
txta.Text = “”
txtb.Text = “”
txtc.Text = “”
txtd.Text = “”
txte.Text = “”
End Sub

Private Sub cmdproses_Click()
Dim jb, pg, tt As String
Dim pt, hg As Variant
txtc.Text = “20″ & Mid(cbo.Text, 5, 2)
a = Left(cbo.Text, 3)
If a = “sim” Then
jb = “sistem informasi management”
pg = “fadiya ulfa”
hg = “75900″
ElseIf a = “edp” Then
jb = “elektronic data processing”
pg = “nurul agustina”
hg = “62000″
ElseIf a = “mnj” Then
jb = “manajemen”
pg = “rian hidayat”
hg = “42000″
ElseIf a = “cdr” Then
jb = “coreldraw”
pg = “siti nur khotimah”
hg = “53000″
ElseIf a = “rpl” Then
jb = “rekayasa perangkat lunak”
pg = “winda erlianti”
hg = “83000″
End If
txta.Text = jb
txtb.Text = pg
txte.Text = hg
a = Right(cbo.Text, 1)
If a = “a” Then
pt = “andi offset yogyakarta”
ElseIf a = “i” Then
pt = “indah surabaya”
ElseIf a = “s” Then
pt = “selemba empat”
ElseIf a = “e” Then
pt = “elek media komputindo”
ElseIf a = “m” Then
pt = “maxicom”
End If
txtd.Text = pt
End Sub

Private Sub Form_Load()
cbo.AddItem “sim-09-a”
cbo.AddItem “edp-10-i”
cbo.AddItem “mnj-11-s”
cbo.AddItem “cdr-12-e”
cbo.AddItem “rpl-13-m”
End Sub

By priliantinovitasari

tugas VB : No 7

Untitled

Private Sub batal_Click()
cbo.SetFocus
cbo.Text = “”
txta.Text = “”
txtb.Text = “”
txtc.Text = “”
txtd.Text = “”
txte.Text = “”
End Sub

Private Sub keluar_Click()
End
End Sub

Private Sub lagi_Click()
cbo.SetFocus
cbo.Text = “”
txta.Text = “”
txtb.Text = “”
txtc.Text = “”
txtd.Text = “”
txte.Text = “”
End Sub

Private Sub proses_Click()
Dim jb, pg, tt As String
Dim pt, hg As Variant
txtc.Text = “20″ & Right(cbo.Text, 2)
a = Mid(cbo.Text, 3, 3)
If a = “sim” Then
jb = “sistem informasi management”
pg = “yati nur oktavia”
hg = “75900″
ElseIf a = “edp” Then
jb = “elektronic data processing”
pg = “imam tarmizi”
hg = “62000″
ElseIf a = “mnj” Then
jb = “manajemen”
pg = “valentina mariana adiwianti”
hg = “42000″
ElseIf a = “cdr” Then
jb = “coreldraw”
pg = “riyan suhandi”
hg = “53000″
ElseIf a = “rpl” Then
jb = “rekayasa perangkat lunak”
pg = “sinta umpu singa”
hg = “83000″
End If
txta.Text = jb
txtb.Text = pg
txte.Text = hg
a = Left(cbo.Text, 1)
If a = “a” Then
pt = “andi offset yogyakarta”
ElseIf a = “i” Then
pt = “indah surabaya”
ElseIf a = “s” Then
pt = “selemba empat”
ElseIf a = “e” Then
pt = “elek media komputindo”
ElseIf a = “m” Then
pt = “maxicom”
End If
txtd.Text = pt
End Sub

Private Sub Form_Load()
cbo.AddItem “a-sim-01″
cbo.AddItem “i-edp-02″
cbo.AddItem “s-mnj-03″
cbo.AddItem “e-cdr-04″
cbo.AddItem “m-rpl-05″
End Sub

By priliantinovitasari

tugas VB : No.5

MVBP

Private Sub chKB_Click()
If Chkb.Value = 1 Then
Lbljudul.FontB = True
Else
Lbljudul.FontB = False
End If
End Sub
Private Sub chKI_Click()
If ChkI.Value = 1 Then
Lbljudul.FontI = True
Else
Lbljudul.FontI = False
End If
End Sub
Private Sub chKS_Click()
If ChKS.Value = 1 Then
LbljDL.FontS = True
Else
LbljDL.FontS = False
End If
End Sub
Private Sub chku_Click()
If Chku.Value = 1 Then
Lbljudul.FontU = True
Else
Lbjudul.FontU = False
End If
End Sub
Private Sub exit_Click()
End
End Sub
Private Sub blue_Click()
Lbljudul.ForeColor = vbBlue
End Sub
Private Sub green_Click()
Lbljudul.ForeColor = vbGreen
End Sub
Private Sub red_Click()
Lbljudul.ForeColor = vbRed
End Sub
Private Sub yellow_Click()
Lbljudul.ForeColor = vbYellow
End Sub

By priliantinovitasari

tugas VB : No. 4

P1

Private Sub Cbo_Click()

Dim gapok, pajak, tunjangan, total As Variant

Select Case CBO.Text

Case “1″

gapok = 700000

tunjangan = 700000

Case “2″

gapok = 55000000

tunjangan = 500000

Case “3″

gapok = 300000

tunjangan = 200000

Case “4″

gapok = 5000000

tunjangan = 500000

Case Else

gapok = 0

tunjangan = 0

End Select

total = gapok + tunjangan

pajak = total * 0.1

Text3.Text = gapok

Text4.Text = tunjangan

Text5.Text = pajak

Text6.Text = total – pajak

End Sub

Private Sub Lagi_Click()

kosong

End Sub

 

Private Sub Batal_Click()

kosong

End Sub

 

Private Sub Keluar_Click()

kosong

End Sub

Private Sub Form_Load()

CBO.AddItem “1″

CBO.AddItem “2″

CBO.AddItem “3″

CBO.AddItem “4″

End Sub

Public Sub kosong()

Text1.SetFocus

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

End Sub

 

 

 

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

 

By priliantinovitasari

tugas VB : No. 3

UN;LLMMTY

Private Sub Command1_Click()
Dim a As String
tm.Text = “20″ & Left(NPM.Text, 2)
a = Mid(NPM.Text, 3, 1)
If a = “1″ Then
jr = “sistem informasi”
ElseIf a = “2″ Then
jr = “manajemen informatika”
ElseIf a = “3″ Then
jr = ” teknik informatika”
ElseIf a = “4″ Then
jr = “komputer akuntansi”
End If
jrs.Text = jr
a = Mid(NPM.Text, 4, 2)
If a = “01″ Then
ps = “strata satu”
ElseIf a = “02″ Then
ps = “diploma empat”
ElseIf ps = “03″ Then
ps = “diploma tiga”
ElseIf ps = “04″ Then
ps = “diploma dua”
End If
ps.Text = ps
no.Text = Right(NPM.Text, 3)
End Sub

Private Sub Command2_Click()
nama.SetFocus
nama.Text = “”
NPM.Text = “”
jrs.Text = “”
ps.Text = “”
tm.Text = “”
no.Text = “”
End Sub

Private Sub Command3_Click()
nama.SetFocus
nama.Text = “”
NPM.Text = “”
jrs.Text = “”
ps.Text = “”
tm.Text = “”
no.Text = “”
End Sub

Private Sub Command4_Click()
End
End Sub

Private Sub nama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
NPM.SetFocus
End If
End Sub

By priliantinovitasari

tugas VB : No. 2

NMP

Private Sub cbo_Click()
Dim nama, jurusan, NM As String
Select Case CBO.Text
Case “12201118”
nama = “PRILIANTI NOVITA SARI”
jurusan = “MANAJEMEN INFORMATIKA”
Case “12201119”
nama = “YILIANTORO”
jurusan = “manajemen informatika”
Case “20112009”
nama = “YUPRIL”
jurusan = “sistem informasi”
End Select
TXTJ.Text = nama
TxtK.Text = jurusan
TXTL.SetFocus
End Sub
Private Sub cmdBTL_Click()
CBO.SetFocus
TXTJ = “”
TxtK = “”
TXTL = “”
TXTM = “”
TXTN = “”
TXTO = “”
TXTP = “”
TXTHR = “”
End Sub
Private Sub cmdKELUAR_Click()
End
End Sub
Private Sub cmdProses_Click()
Dim na As Integer
Dim HR As String
QUIS = Val(TXTL.Text)
TUGAS = Val(TXTM.Text)
UTS = Val(TXTN.Text)
UAS = Val(TXTO.Text)
na = (QUIS + TUGAS + UTS + UAS) / 4
TXTP.Text = na
Select Case TXTP.Text
Case Is > 80
HR = “A”
Case Is > 70
HR = “B”
Case Is > 60
HR = “C”
Case Is > 50
HR = “D”
Case Is < 50
HR = “E”
End Select
TXTHR.Text = HR
End Sub

Private Sub Form_Load()
CBO.AddItem “12101111”
CBO.AddItem “12201119”
CBO.AddItem “11202009”
End Sub
Private Sub txtH_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTH.SetFocus
End If
End Sub
Private Sub txtI_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTI.SetFocus
End If
End Sub
Private Sub txtJ_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTJ.SetFocus
End If
End Sub

By priliantinovitasari

tugas VB : No. 1

1

Private Sub CMDKELUAR_Click()
End
End Sub

Private Sub CMDPROSES_Click()
Dim a, b, c, d, f As String
Txtgajikotor.Text = Val(Txtgajipokok.Text) + Val(Txttunjangan.Text) – Val(Txtpotongan.Text)
txtpajak.Text = Val(Txtgajikotor.Text) * 0.1
Txtgajiyangditerima.Text = Val(Txtgajikotor.Text) – Val(txtpajak.Text)

End Sub

Private Sub CMDULANG_Click()
Txtgajipokok.SetFocus
Txtgajipokok.Text = “”
Txttunjangan.Text = “”
Txtpotongan.Text = “”
Txtgajikotor.Text = “”
txtpajak.Text = “”
Txtgajiyangditerima.Text = “”

End Sub

Private Sub Txtgajipokok_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttunjangan.SetFocus
End If
End Sub

Private Sub Txttunjangan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtpotongan.SetFocus
End If

End Sub

By priliantinovitasari

tugas VB : No. 1

Private Sub CMDKELUAR_Click()
End
End Sub

Private Sub CMDPROSES_Click()
Dim a, b, c, d, f As String
Txtgajikotor.Text = Val(Txtgajipokok.Text) + Val(Txttunjangan.Text) – Val(Txtpotongan.Text)
txtpajak.Text = Val(Txtgajikotor.Text) * 0.1
Txtgajiyangditerima.Text = Val(Txtgajikotor.Text) – Val(txtpajak.Text)

End Sub

Private Sub CMDULANG_Click()
Txtgajipokok.SetFocus
Txtgajipokok.Text = “”
Txttunjangan.Text = “”
Txtpotongan.Text = “”
Txtgajikotor.Text = “”
txtpajak.Text = “”
Txtgajiyangditerima.Text = “”

End Sub

Private Sub Txtgajipokok_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttunjangan.SetFocus
End If
End Sub

Private Sub Txttunjangan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtpotongan.SetFocus
End If

End Sub

By priliantinovitasari
Image

total-harga-setelah-diskon-10.png

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()
End
End Sub

By priliantinovitasari