database mahasiswa visual basic

arif

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

Private Sub Command1_Click()
Dim s As String
Text5.Text = “20” & Left(Text2.Text, 2)
s = Mid(Text2.Text, 3, 1)
If s = “1” Then
s = “Sistem Informasi”
ElseIf s = “2” Then
s = “Manajemen Informasi”
ElseIf s = “3” Then
s = “Tekhnik Informasi”
End If
Text3.Text = s
b = Mid(Text2.Text, 4, 2)
If b = “00” Then
b = “strata 1”
ElseIf b = “01” Then
b = “Diploma 3”
ElseIf b = “02” Then
b = “Diploma 2”
End If
Text4.Text = b
Text6.Text = Right(Text2.Text, 3)
End Sub

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

Private Sub Command3_Click()
Data1.Recordset.Update
Data1.Recordset.AddNew
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub Command4_Click()
Data1.Recordset.AddNew
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Command6_Click()
Data1.Refresh
Text1.SetFocus
End Sub

Private Sub Command7_Click()
Data1.Recordset.Delete
Text1.SetFocus
End Sub

Advertisements
Posted in Uncategorized | Leave a comment

Tugas VB #4#

1.

1.4

Private Sub Cmdpros_Click()

Dim S As String

Txtthn.Text = “20” & Right(Txtkdbu.Text, 2)

S = Left(Txtkdbu.Text, 1)

If S = “A” Then

Pnr = “Andi Offset Yogyakarta”

ElseIf S = “I” Then

Pnr = “Indah Surabaya”

ElseIf S = “S” Then

Pnr = “Salemba Empat”

ElseIf S = “E” Then

Pnr = “Elek Media Komputindo”

ElseIf S = “M” Then

Pnr = “Maxicom”

End If

S = Mid(Txtkdbu.Text, 3, 3)

If S = “SIM” Then

Jdb = “Sisitem Informasi Manajemen”

Peng = “Andra Setiawan”

Hrg = “75900”

ElseIf S = “EDP” Then

Jdb = “Elektronik Data Processing”

Peng = “Desi Istiqomah”

Hrg = “62000”

ElseIf S = “MNJ” Then

Jdb = “Manajemen”

Peng = “Sandy Fitrajaya”

Hrg = “42000”

ElseIf S = “CDR” Then

Jdb = “Corel draw”

Peng = “Tri Indah Sari”

Hrg = “53000”

ElseIf S = “RPL” Then

Jdb = “Rekayasa Perangkat Lunak”

Peng = “Ernita”

Hrg = “83000”

End If

Txtpnr.Text = Pnr

Txtjdb.Text = Jdb

Txtpeng.Text = Peng

Txthrg.Text = Hrg

End Sub.

 

Private Sub Cmdlagi_Click()

Txtkdbu.SetFocus

Txtkdbu.Text = “”

Txtjdb.Text = “”

Txtpeng.Text = “”

Txtthn.Text = “”

Txtpnr.Text = “”

Txthrg.Text = “”

End Sub

 

Private Sub Cmdbtl_Click()

Txtkdbu.SetFocus

Txtkdbu.Text = “”

Txtjdb.Text = “”

Txtpeng.Text = “”

Txtthn.Text = “”

Txtpnr.Text = “”

Txthrg.Text = “”

End Sub

 

Private Sub Cmdkelwr_Click()

End

End Sub

2.

2.4

Private Sub Cmdpros_Click()

Dim S As String

Txtthn.Text = “20” & Mid(Txtkdbu.Text, 5, 2)

S = Right(Txtkdbu.Text, 1)

If S = “A” Then

Pnr = “Andi Offset Yogyakarta”

ElseIf S = “I” Then

Pnr = “Indah Surabaya”

ElseIf S = “S” Then

Pnr = “Salemba Empat”

ElseIf S = “E” Then

Pnr = “Elek Media Komputindo”

ElseIf S = “M” Then

Pnr = “Maxicom”

End If

S = Left(Txtkdbu.Text, 3)

If S = “SIM” Then

Jdb = “Sisitem Informasi Manajemen”

Peng = “Fadiya Ulfa”

Hrg = “75900”

ElseIf S = “EDP” Then

Jdb = “Elektronik Data Processing”

Peng = “Nurul Agustina”

Hrg = “62000”

ElseIf S = “MNJ” Then

Jdb = “Manajemen”

Peng = “Rian Hidayat”

Hrg = “42000”

ElseIf S = “CDR” Then

Jdb = “Corel draw”

Peng = “Siti Nur Khotimah”

Hrg = “53000”

ElseIf S = “RPL” Then

Jdb = “Rekayasa Perangkat Lunak”

Peng = “Winda Erlianti”

Hrg = “83000”

End If

Txtpnr.Text = Pnr

Txtjdb.Text = Jdb

Txtpeng.Text = Peng

Txthrg.Text = Hrg

End Sub

 

Private Sub Cmdlagi_Click()

Txtkdbu.SetFocus

Txtkdbu.Text = “”

Txtjdb.Text = “”

Txtpeng.Text = “”

Txtthn.Text = “”

Txtpnr.Text = “”

Txthrg.Text = “”

End Sub

 

Private Sub Cmdbtl_Click()

Txtkdbu.SetFocus

Txtkdbu.Text = “”

Txtjdb.Text = “”

Txtpeng.Text = “”

Txtthn.Text = “”

Txtpnr.Text = “”

Txthrg.Text = “”

End Sub

 

Private Sub Cmdkelwr_Click()

End

End Sub

3.

3.4

Private Sub Txtnm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnik.SetFocus

End If

End Sub

 

Private Sub Cmdprs_Click()

Dim Jbt, Bag, Gol, Ks, St As String

Dim Gjp, Tun, Tgj As Currency

Txtthn.Text = Left(Txtnik.Text, 4)

Z = Mid(Txtnik.Text, 5, 1)

If Z = “A” Then

Gol = “A”

Jbt = “Manajer”

Gjp = “4000000”

Tun = “1025000”

ElseIf Z = “B” Then

Gol = “B”

Jbt = “Ka.seksi”

Gjp = “3500000”

Tun = “975000”

ElseIf Z = “C” Then

Gol = “C”

Jbt = “Staff”

Gjp = “3000000”

Tun = “925000”

End If

 

Z = Mid(Txtnik.Text, 7, 1)

If Z = “S” Then

Ks = “S”

St = “Single”

ElseIf Z = “M” Then

Ks = “M”

St = “Menikah”

ElseIf Z = “J” Then

Ks = “J”

St = “Janda”

ElseIf Z = “D” Then

Ks = “D”

St = “Duda”

End If

 

Z = Right(Txtnik.Text, 3)

If Z = “KEU” Then

Bag = “Accounting”

ElseIf Z = “ADM” Then

Bag = “Administrasi”

ElseIf Z = “SDM” Then

Bag = “General Affair”

ElseIf Pt = “EDP” Then

Bag = “IT Unit”

ElseIf Z = “SPM” Then

Bag = “Security”

End If

Tgj = Val(Gjp) + Val(Tnj)

Txtgjp.Text = Gjp

Txtjbt.Text = Jbt

Txttun.Text = Tun

Txtstat.Text = St

Txtbag.Text = Bag

Txtgol.Text = Gol

Txtkod.Text = Ks

Txttgj.Text = Tgj

End Sub

 

Private Sub Cmdlagi_Click()

Txtnm.SetFocus

Txtnm = “”

Txtgol = “”

Txtkod = “”

Txtstat = “”

Txtthn = “”

Txtjbt = “”

Txtbag = “”

Txtgjp = “”

Txttun = “”

Txttgj = “”

Txtnik = “”

End Sub

 

Private Sub Cmdbtl_Click()

Txtnm.SetFocus

Txtnm = “”

Txtgol = “”

Txtkod = “”

Txtstat = “”

Txtthn = “”

Txtjbt = “”

Txtbag = “”

Txtgjp = “”

Txttun = “”

Txttgj = “”

Txtnik = “”

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

4.

4.4

Private Sub Cbokod_DblClick()

Private Sub form_load()

Cbokod.AddItem “A-SIM-01”

Cbokod.AddItem “I-EDP-02”

Cbokod.AddItem “S-MNJ-03”

Cbokod.AddItem “E-CDR-O4”

Cbokod.AddItem “M-RPL-05”

End Sub

 

Private Sub Cmdproses_Click()

Dim P As String

Txtthn.Text = “20” & Right(Cbokod.Text, 2)

P = Left(Cbokod.Text, 1)

If P = “A” Then

Pn = “Andi Offset Yogyakarta”

ElseIf P = “I” Then

Pn = “Indah Surabaya”

ElseIf P = “S” Then

Pn = “Salemba Empat”

ElseIf P = “E” Then

Pn = “Elek Media Komputindo”

ElseIf P = “M” Then

Pn = “Maxicom”

End If

P = Mid(Cbokod.Text, 3, 3)

If P = “SIM” Then

Jbk = “Sisitem Informasi Manajemen”

Png = “Yati Nur Oktavia”

Hrg = “75900”

ElseIf P = “EDP” Then

Jbk = “Elektronik Data Processing”

Png = “Imam Tarmizi”

Hrg = “62000”

ElseIf P = “MNJ” Then

Jbk = “Manajemen”

Png = “Valentina Mariana Adiwianti”

Hrg = “42000”

ElseIf P = “CDR” Then

Jbk = “Corel draw”

Png = “Riyan Suhadi”

Hrg = “53000”

ElseIf P = “RPL” Then

Jbk = “Rekayasa Perangkat Lunak”

Png = “Sinta Umpu Singa”

Hrg = “83000”

End If

Txtpnr.Text = Pn

Txtjbu.Text = Jbk

Txtpeng.Text = Png

Txthrg.Text = Hrg

End Sub

 

Private Sub Cmdlagi_Click()

Cbokod.SetFocus

Cbokod.Text = “”

Txtjbu.Text = “”

Txtpeng.Text = “”

Txtthn.Text = “”

Txtpnr.Text = “”

Txthrg.Text = “”

End Sub

 

Private Sub Cmdbtl_Click()

Cbokod.SetFocus

Cbokod.Text = “”

Txtjbu.Text = “”

Txtpeng.Text = “”

Txtthn.Text = “”

Txtpnr.Text = “”

Txthrg.Text = “”

End Sub

 

Private Sub Cmdexit_Click()

Unload Me

End Sub

 

Posted in Uncategorized | Leave a comment

Tugas VB #3#

1.

ar1

Private Sub Cbonpm_DblClick()

Private Sub form_load()

Cbonpm.AddItem “12100530”

Cbonpm.AddItem “12100207”

Cbonpm.AddItem “12100217”

Cbonpm.AddItem “12201109”

Cbonpm.AddItem “12201265”

End Sub

 

Private Sub Cbonpm_Click()

Dim nama, jurusan, AsString

 

Select Case Cbonpm.Text

Case “12201102”

nama = “Arif Hidayahtulloh”

jurusan = “Sistem Informasi”

Case “12100207”

nama = “Linda”

jurusan = “Sistem Informasi”

Case “12100217”

nama = “Eko Mualip”

jurusan = “Sisitem Informasi”

Case “12201109”

nama = “Didi Sumantri”

jurusan = “Manajemen Informatika”

Case “12201265”

nama = “Lilik S”

jurusan = “Manajemen Informatika”

End Select

Txtnm.Text = nama

Txtjur.Text = jurusan

Txtnqu.SetFocus

End Sub

 

 

Private Sub Txtnqu_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtntgs.SetFocus

End If

End Sub

 

Private Sub Txtntgs_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(Txtnqu.Text)

tugas = Val(Txtntgs.Text)

uts = Val(Txtuts.Text)

uas = Val(Txtuas.Text)

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

Txtnla.Text = NilaiAkhir

 

Select Case Txtnla.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

Txthrfm.Text = HurufMutu

End Sub

 

Private Sub Cmdbtl_Click()

Cbonpm.SetFocus

Cbonpm = “”

Txtnm = “”

Txtjur = “”

Txtnqu = “”

Txtntgs = “”

Txtuts = “”

Txtuas = “”

Txtnla = “”

Txthrfm = “”

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

2.

ar2

Private Sub Optmrh_Click()

Lbljudul.ForeColor = vbRed

End Sub

 

Private Sub Opthj_Click()

Lbljudul.ForeColor = vbGreen

End Sub

 

Private Sub Chkmrg_Click()

Lbljudul.FontItalic = Chkmrg.Value

End Sub

 

Private Sub Chktbl_Click()

Lbljudul.FontBold = Chktbl.Value

End Sub

 

Private Sub Cmdok_Click()

Lbljudul.Caption = Txtnma.Text

End Sub

 

Private Sub Cmdkel_Click()

End

End Sub

3.

ar3

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, Total As Variant

Select Case Cbogol.Text

Case “I”

Gajipokok = 1500000

Tunjangan = 400000

Case “II”

Gajipokok = 2000000

Tunjangan = 600000

 

Case “III”

Gajipokok = 2500000

Tunjangan = 800000

Case “IV”

Gajipokok = 3000000

Tunjangan =1000000

Case Else

Gajipokok = 0

Tunjangan = 0

End Select

Total = Gajipokok + Tunjangan

Pajak = Total * 0.1

Txtgp.Text = Gajipokok

Txttj.Text = Tunjangan

Txtpj.Text = Pajak

Txttl.Text = Total – Pajak

 

 

Private Sub Cmdlgi_Click()

Txtnidn = “”

Txtnpg = “”

Cbogol = “”

Txtgp = “”

Txttj = “”

Txtpj = “”

Txttl = “”

End Sub

 

Private Sub Cmdbtl_Click()

Txtnidn = “”

Txtnpg = “”

Cbogol = “”

Txtgp = “”

Txttj = “”

Txtpj = “”

Txttl = “”

End Sub

 

Private Sub Cmdklr_Click()

End

End Sub

4.

Private Sub Txtnm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnpm.SetFocus

End If

End Sub

 

 

Private Sub Cmdproses_Click()

Dim S As String

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

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

If S = “1” Then

Txtjrsn.Text = “Sisitem Informasi”

ElseIf S = “2” Then

Txtjrsn.Text = “Manajemen Informatika”

ElseIf S = “3” Then

Txtjrsn.Text = “Komputer Akuntansi Manajemen”

ElseIf S = “4” Then

Txtjrsn.Text = “Tehnik Informatika”

End If

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

If S = “00” Then

Txtpst.Text = “Strata Satu”

ElseIf S = “01” Then

Txtpst.Text = “Diploma Tiga”

ElseIf S = “02” Then

Txtpst.Text = “Diploma Dua”

ElseIf S = “03” Then

Txtpst.Text = “Diploma Empat”

End If

S = Right(Txtnpm.Text, 3)

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

End Sub

 

Private Sub Cmdlgi_Click()

Txtnm.SetFocus

Txtnm = “”

Txtnpm = “”

Txtjrsn = “”

Txtpst = “”

Txtthnm = “”

Txtrut = “”

End Sub

 

Private Sub Cmdbtl_Click()

Txtnama.SetFocus

Txtnm = “”

Txtnpm = “”

Txtjrsn = “”

Txtpst = “”

Txtthnm = “”

Txtrut = “”

End Sub

 

Private Sub Cmdklr_Click()

End

End Sub

 

Posted in Uncategorized | Leave a comment