data base

NLA

Private Sub Command1_Click()

Data1.Recordset.Update

End Sub

 

Private Sub Command2_Click()

Data1.Recordset.AddNew

Text1.SetFocus

End Sub

 

 

 

Private Sub Command3_Click()

End

End Sub

 

Iklan

tugas 6

nilav

 

Private Sub cmdbatal_Click()

txtnama.SetFocus

txtnama.Text = “”

txtnpm.Text = “”

txtkel.Text = “”

txtjur.Text = “”

txtpro.Text = “”

txtthn.Text = “”

txtno.Text = “”

txtup.Text = “”

txtbipes.Text = “”

txtub.Text = “”

txtbipa.Text = “”

txttot.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

txtnama.SetFocus

txtnama.Text = “”

txtnpm.Text = “”

txtkel.Text = “”

txtjur.Text = “”

txtpro.Text = “”

txtthn.Text = “”

txtno.Text = “”

txtup.Text = “”

txtbipes.Text = “”

txtub.Text = “”

txtbipa.Text = “”

txttot.Text = “”

End Sub

 

Private Sub cmdproses_Click()

Dim eksekutif, reguler, tahun, jurusan, study, kelas, no As String

n = Left(txtnpm.Text, 1)

If n = “E” Or n = “e” Then

kelas = “Eksekutif”

bangunan = “1250000”

ElseIf n = “R” Or n = “r” Then

kelas = “Reguler”

bangunan = “1000000”

End If

property = “600000”

txtbipa.Text = property

txtub.Text = bangunan

tahun = “20” & Mid(txtnpm.Text, 3, 2)

txtthn.Text = tahun

txtkel.Text = kelas

n = Mid(txtnpm.Text, 5, 1)

If n = “1” Then

jurusan = “Sistem Informasi”

ElseIf n = “2” Then

jurusan = “Manajemen Informatika”

ElseIf n = “3” Then

jurusan = “Manajemen dan Kom. Akuntansi”

End If

txtjur.Text = jurusan

n = Mid(txtnpm.Text, 6, 2)

If n = “01” Or n = “00” Then

study = “Strata Satu”

biaya = “200000”

ElseIf n = “02” Then

study = “Diploma Tiga”

biaya = “150000”

ElseIf n = “03” Then

study = “Diploma Satu”

biaya = “150000”

End If

If kelas = “Eeksekutif” And study = “strata satu” Then

pendidikan = “1900000”

ElseIf kelas = “Eeksekutif” And study = “Diploma Tiga” Then

pendidikan = “1650000”

ElseIf kelas = “Eeksekutif” And study = “Diploma satu” Then

pendidikan = “1350000”

ElseIf kelas = “Reguler” And study = “Strata Satu” Then

pendidikan = “1500000”

ElseIf kelas = “Reguler” And study = “Diploma Tiga” Then

pendidikan = “1250000”

ElseIf kelas = “Reguler” And study = “Diploma Satu” Then

pendidikan = “1250000”

 

End If

txtkel.Text = kelas

txtpro.Text = study

txtbipes.Text = pendidikan

 

no = Right(txtnpm.Text, 3)

txtno.Text = no

txtup.Text = biaya

txttot.Text = Val(txtup.Text) + Val(txtbipes.Text) + Val(txtub.Text) + Val(txtbipa.Text)

 

 

End Sub

 

 

 

Private Sub txtnama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnpm.SetFocus

End If

End Sub

nila

Private Sub cmdproses_Click()

 

kodetiket = Left(txtkt.Text, 3)

 

If kodetiket = “bim” Then

jeniskereta = “bima”

hatgatiket = “50000”

jamberangkat = “16.00”

ElseIf kodetiket = “eko” Then

jeniskereta = “ekonomi”

hargatiket = “35000”

jamberangkat = “19.00”

ElseIf kodetiket = “mut” Then

jeniskereta = “mutiara”

hargatiket = “23000”

jamberangkat = “17.00”

ElseIf kodetiket = “sen” Then

jeniskereta = “senja”

hargatiket = “15000”

jamberangkat = “20000”

 

End If

txtkt.Text = kodetiket

txtjk.Text = jeniskereta

txtht.Text = hargatiket

txtjb.Text = jamberangkat

 

txtjt.SetFocus

 

End Sub

 

Private Sub Form_Activate()

txtkt.SetFocus

End Sub

 

 

Private Sub txtjt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttotalp.Text = Val(txtht.Text) * Val(txtjt.Text)

End If

End Sub

NILA

Private Sub cmdbersih_Click()
txtbil1.Text = “”
txtbil2.Text = “”
txthasil.Text = “”
End Sub

Private Sub cmdhitung_Click()
txthasil.Text = Val(txtbil1.Text) * Val(txtbil2.Text)
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub