3. Tugas 3 (Database)

Nama : RINI ASTUTI
NPM : 11100113

TUGAS DATABASE

KODE PROGRAM

Private Sub Cmdadd_Click()
Txtnama.SetFocus
Txtnama.Text = ” ”
Txtnpm.Text = ” ”
Txtkelas.Text = ” ”
Txtjur.Text = ” ”
TxtPS.Text = ” ”
Txttm.Text = ” ”
Txtnu.Text = ” ”
Txtuang.Text = ” ”
Txtbiaya.Text = ” ”
TxtUB.Text = ” ”
TxtBA.Text = ” ”
TxtTot.Text = ” ”
End Sub

Private Sub Cmdbatal_Click()
Txtnama.SetFocus
Txtnama.Text = ” ”
Txtnpm.Text = ” ”
Txtkelas.Text = ” ”
Txtjur.Text = ” ”
TxtPS.Text = ” ”
Txttm.Text = ” ”
Txtnu.Text = ” ”
Txtuang.Text = ” ”
Txtbiaya.Text = ” ”
TxtUB.Text = ” ”
TxtBA.Text = ” ”
TxtTot.Text = ” ”
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtnama.SetFocus
Txtnama.Text = ” ”
Txtnpm.Text = ” ”
Txtkelas.Text = ” ”
Txtjur.Text = ” ”
TxtPS.Text = ” ”
Txttm.Text = ” ”
Txtnu.Text = ” ”
Txtuang.Text = ” ”
Txtbiaya.Text = ” ”
TxtUB.Text = ” ”
TxtBA.Text = ” ”
TxtTot.Text = ” ”
End Sub

Private Sub Cmdproses_Click()
Dim npm As String

npm = Left(Txtnpm.Text, 1)
If npm = “E” Or npm = “e” Then
Txtkelas.Text = “Eksekutif”
ElseIf npm = “R” Or npm = “r” Then
Txtkelas.Text = “Reguler”
End If

npm = Mid(Txtnpm.Text, 5, 1)
If npm = “1” Then
Txtjur.Text = “Sistem Informasi”
ElseIf npm = “2” Then
Txtjur.Text = “Manajemen Informatika”
ElseIf npm = “3” Then
Txtjur.Text = “Manajemen Dan Komputer Akutansi”
End If

npm = Mid(Txtnpm.Text, 6, 2)
If npm = “01” Then
TxtPS.Text = “Strata Satu”
ElseIf npm = “02” Then
TxtPS.Text = “Diploma tiga”
ElseIf npm = “03” Then
TxtPS.Text = “Diploma Satu”
End If

npm = Mid(Txtnpm.Text, 3, 2)
Txttm.Text = “20” & Mid(Txtnpm.Text, 3, 2)

npm = Right(Txtnpm.Text, 3)
Txtnu.Text = npm

If Txtkelas.Text = “Eksekutif” Or Txtkelas.Text = “Reguler” Or TxtPS.Text = “strata satu” Then
Txtuang.Text = “200000”
ElseIf TxtPS.Text = “Diploma Tiga” Or TxtPS.Text = “Diploma Satu” Then
TxtPS.Text = “150000”
End If

If Txtkelas.Text = “Eksekutif” Or TxtPS.Text = “strata Satu” Then
Txtbiaya.Text = “1900000”
ElseIf TxtPS.Text = “Diploma Tiga” Then
Txtbiaya.Text = “1650000”
ElseIf TxtPS.Text = “Diploma Satu” Then
Txtbiaya.Text = “1350000”
ElseIf Txtkelas.Text = “Reguler” Or TxtPS.Text = “strata satu” Then
Txtbiaya.Text = “1500000”
ElseIf TxtPS.Text = “Diploma Tiga” Or TxtPS.Text = “Diploma Satu” Then
Txtbiaya.Text = “1250000”
End If

If Txtkelas.Text = “Eksekutif” Or TxtPS.Text = “strata Satu” Or TxtPS.Text = “diploma tiga” Or TxtPS.Text = “Diploma Satu” Then
TxtUB.Text = “1250000”
ElseIf Txtkelas.Text = “Reguler” Or TxtPS.Text = “Strata Satu” Or TxtPS.Text = “diploma Tiga” Or TxtPS.Text = “diploma Satu” Then
TxtUB.Text = “1000000”
End If

If Txtkelas.Text = “Eksekutif” Or Txtkelas.Text = “Reguler” Or TxtPS.Text = “strata Satu” Or TxtPS.Text = “diploma Tiga” Or TxtPS.Text = “diploma tiga” Then
TxtBA.Text = “600000”
End If

TxtTot.Text = Val(Txtuang.Text) + Val(Txtbiaya.Text) + Val(TxtUB.Text) + Val(TxtBA.Text)
TxtTot.SetFocus
End Sub

Private Sub Cmdsave_Click()
With Data1.Recordset
.AddNew
.Fields(“nama”) = Txtnama.Text
.Fields(“npm”) = Txtnpm.Text
.Fields(“kelas”) = Txtkelas.Text
.Fields(“jurusan”) = Txtjur.Text
.Fields(“program study”) = TxtPS.Text
.Fields(“tahunmasuk”) = Txttm.Text
.Fields(“nomorurut”) = Txtnu.Text
.Fields(“uangpendaftaran”) = Txtuang.Text
.Fields(“biayapendidikan”) = Txtbiaya.Text
.Fields(“uangbangunan”) = TxtUB.Text
.Fields(“biayapropti”) = TxtBA.Text
.Fields(“totalbiaya”) = TxtTot.Text
End With
End Sub

Private Sub Cmdupdate_Click()
With Data1.Recordset
.Edit
.Fields(“nama”) = Txtnama.Text
.Fields(“npm”) = Txtnpm.Text
.Fields(“kelas”) = Txtkelas.Text
.Fields(“jurusan”) = Txtjur.Text
.Fields(“program study”) = TxtPS.Text
.Fields(“tahunmasuk”) = Txttm.Text
.Fields(“nomorurut”) = Txtnu.Text
.Fields(“uangpendaftaran”) = Txtuang.Text
.Fields(“biayapendidikan”) = Txtbiaya.Text
.Fields(“uangbangunan”) = TxtUB.Text
.Fields(“biayapropti”) = TxtBA.Text
.Fields(“totalbiaya”) = TxtTot.Text
.Update
End With
End Sub

Private Sub Txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtnpm.SetFocus
End If
End Sub

Private Sub Txtnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Cmdproses.SetFocus
End If
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • %d bloggers like this: