INTEGRASI ACCES

tugas vb mumet

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

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

Private Sub Command3_Click()
Adodc1.Recordset.Update
MsgBox “data berhasil disimpan…!!!”, vbOKOnly + vbInformation, “konfirmasi”
End Sub

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

Private Sub Command5_Click()
End
End Sub

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

 

pt tidak masuk tidak apa-apa

tugas ke2.9

Private Sub cmdBTL_Click()
txtNK.SetFocus
txtGOL.Text = “”
txtKS.Text = “”
txtS.Text = “”
txtTH.Text = “”
txtJB.Text = “”
txtBG.Text = “”
txtGPOK.Text = “”
txtTNJ.Text = “”
txtTTAL.Text = “”
txtNK.Text = “”
txtNIK.Text = “”
End Sub

Private Sub cmdKL_Click()
End
End Sub

Private Sub cmdLG_Click()
txtNK.SetFocus
txtGOL.Text = “”
txtKS.Text = “”
txtS.Text = “”
txtTH.Text = “”
txtJB.Text = “”
txtBG.Text = “”
txtGPOK.Text = “”
txtTNJ.Text = “”
txtTTAL.Text = “”
txtNK.Text = “”
txtNIK.Text = “”
End Sub

Private Sub cmdPRS_Click()
Dim gl, ks, s As String
Dim th, jb, bg As Variant
Dim gp, tnj, ttal As Long
txtTH.Text = Left(txtNIK.Text, 4)
a = Mid(txtNIK.Text, 5, 1)
If a = “A” Then
gl = “A”
jb = “Manager”
gp = “4000000″
tnj = “1025000″
ElseIf a = “B” Then
gl = “B”
jb = “Ka. Seksi”
gp = “3500000″
tnj = “975000″
ElseIf a = “C” Then
gl = “C”
jb = “Staff”
gp = “3000000″
tnj = “950000″
End If
txtGOL.Text = gl
txtJB.Text = jb
txtGPOK.Text = gp
txtTNJ.Text = tnj
a = Right(txtNIK.Text, 3)
If a = “KEU” Then
bg = “Accounting”
ElseIf a = “ADM” Then
bg = “Administrasi”
ElseIf a = “SDM” Then
bg = “General Affair”
ElseIf a = “EDP” Then
bg = “IT Unit”
ElseIf a = “SDP” Then
bg = “Security”
End If
txtBG.Text = bg
a = Mid(txtNIK.Text, 7, 1)
If a = “S” Then
ks = “S”
s = “Single”
ElseIf a = “M” Then
ks = “M”
s = “Menikah”
ElseIf a = “J” Then
ks = “J”
s = “Janda”
ElseIf a = “D” Then
ks = “D”
s = “Duda”
End If
txtKS.Text = ks
txtS.Text = s
txtTTAL.Text = Val(txtGPOK.Text) + Val(txtTNJ.Text)
End Sub

Private Sub txtNK_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtNIK.SetFocus
End If
End Sub

data buku perpustakaan milik bersama 2

tugas ke2.7

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

data buku perpustakaan milik bersama 1

tugas ke2.7

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″ & 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

total gaji

tugas ke2.6

Private Sub Cbo_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case Cbo.Text
Case “I”
gapok = 1500000
tunjangan = 150000
Case “II”
gapok = 2000000
tunjangan = 20000
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
Text3.Text = gapok
Text4.Text = tunjangan
Text5.Text = pajak
Text6.Text = total – pajak
End Sub

Private Sub cmdBTL_Click()
kosong
End Sub

Private Sub cmdKL_Click()
End
End Sub

Private Sub cmdLG_Click()
kosong
End Sub

Private Sub Form_Load()
Cbo.AddItem “I”
Cbo.AddItem “II”
Cbo.AddItem “III”
Cbo.AddItem “IV”
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

Nama n NpM

tugas ke2.5

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

Private Sub Command2_Click()
nama.SetFocus
nama.Text = “”
NPM.Text = “”
jurusan.Text = “”
program.Text = “”
tahun.Text = “”
no.Text = “”
End Sub

Private Sub Command3_Click()
nama.SetFocus
nama.Text = “”
NPM.Text = “”
jurusan.Text = “”
program.Text = “”
tahun.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

MS.VB

tugas ke2.4

Private Sub Check1_Click()
If Check1.Value = 1 Then
Label1.FontBold = True
Else: Label1.FontBold = False
End If
End Sub

Private Sub Check2_Click()
If Check2.Value = 1 Then
Label1.FontItalic = True
Else: Label1.FontItalic = False
End If

End Sub

Private Sub Check3_Click()
If Check3.Value = 1 Then
Label1.FontUnderline = True
Else: Label1.FontUnderline = False
End If

End Sub

Private Sub Check4_Click()
If Check4.Value = 1 Then
Label1.FontStrikethru = True
Else: Label1.FontStrikethru = False
End If
End Sub
Private Sub Command1_Click()
End
End Sub

Private Sub Option1_Click()
Label1.ForeColor = vbRed
End Sub

Private Sub Option2_Click()
Label1.ForeColor = vbGreen

End Sub

Private Sub Option3_Click()
Label1.ForeColor = vbBlue

End Sub

Private Sub Option4_Click()
Label1.ForeColor = vbYellow

End Sub