2. Tugas 2

NAMA : RINI ASTUTI
NPM :11100113
KELAS : YAHOO 6

BEFORE

AFTER

KODE PROGRAM

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
Txtuang.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 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

  1. untuk listyng bersih text nya ganti yang lebih singkat dunk…
    contohnya untuk typedata berupa text,label diganti dgn variabel
    lalu;
    x.text and label.caption=””
    next

    oya usahakan database nya jgn pake ektensi .mdb/access, tapi pake database server..
    silahkan tanyakn pda dosen yang lebih tahu..

    cuma contoh aja.. mga bermnfaat..

    tetap smngt..

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: