TIPE G

tipeg

Private Sub cmdbatal_Click()
txtnama = “”
txtnpm = “”
txtjurusan = “”
txtstudi = “”
txtmasuk = “”
txtnurut = “”
txtbp = “”
txtnama.SetFocus
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
txtnama = “”
txtnpm = “”
txtjurusan = “”
txtstudi = “”
txtmasuk = “”
txtnurut = “”
txtbp = “”
txtnama.SetFocus

End Sub

Private Sub cmdprosess_Click()
Dim a, b, c As String
a = Mid(txtnpm, 3, 1)
If a = “1” Then
jurusan = “Sistem Informasi”
ElseIf a = “2” Then
jurusan = “tekhnik informatika”
ElseIf a = “3” Then
jurusan = “Manajemen Informatika”
ElseIf a = “4” Then
jurusan = “Manajemen & Komp. Akuntansi”
End If
b = Mid(txtnpm, 4, 2)
If b = “01” Then
studi = “Strata Satu ”
bp = “1950000”
ElseIf b = “02” Then
studi = “Diploma Empat ”
bp = “1750000”
ElseIf b = “03” Then
studi = “Diploma Tiga ”
bp = “1650000”
ElseIf b = “04” Then
studi = “Diploma Dua ”
bp = “1450000”
End If
nurut = Right(txtnpm, 3)
masuk = “20” & Left(txtnpm, 2)

txtnurut = nurut
txtstudi = studi
txtjurusan = jurusan
txtbp = bp
txtmasuk = masuk

End Sub

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

Iklan

TIPE I

tipe i

Private Sub Cmdprosess_Click()
Dim a, b, c As String
a = Mid(txtnik, 5, 1)
If a = “A” Then
golongan = “A”
jabatan = “MANAJER”
gaji = “4000000”
tunjangan = “1025000”
ElseIf a = “B” Then
golongan = “B”
jabatan = “Ka.Seksi”
gaji = “3500000”
tunjangan = “975000”
ElseIf a = “C” Then
golongan = “C”
jabatan = “staff”
gaji = “3000000”
tunjangan = “925000”
End If
b = Mid(txtnik, 7, 1)
If b = “S” Then
kode = “S”
Status = “Single”
ElseIf b = “M” Then
kode = “M”
Status = “Menikah”
ElseIf b = “J” Then
kode = “J”
Status = “Janda”
ElseIf b = “D” Then
kode = “D”
Status = “Duda”
End If
c = Right(txtnik, 3)
If c = “KEU” Then
bagian = “ACCOUNTING”
ElseIf c = “ADM” Then
bagian = “ADMINISTRASI”
ElseIf c = “SDM” Then
bagian = “GENERAL AFFAIR”
ElseIf c = “EDP” Then
bagian = “IT UNIT”
ElseIf c = “SPM” Then
bagian = “SECURITY”
End If
txttahun = Left(txtnik, 4)
txtgolongan = golongan
txtjabatan = jabatan
txtstatus = Status
Txtbagian = bagian
txttunjangan = tunjangan
txtgaji = gaji
txtkode = kode
txttotal = Val(txtgaji) + Val(txttunjangan)
End Sub

Private Sub Cmdlagi_Click()
txtnama.SetFocus
txtnama = “”
txtnik = “”
txtgolongan = “”
txtkode = “”
txtstatus = “”
txttahun = “”
txtjabatan = “”
Txtbagian = “”
txtgaji = “”
txttunjangan = “”
txttotal = “”

End Sub

Private Sub cmdbatal_Click()
txtnama.SetFocus
txtnama = “”
txtnik = “”
txtgolongan = “”
txtkode = “”
txtstatus = “”
txttahun = “”
txtjabatan = “”
Txtbagian = “”
txtgaji = “”
txttunjangan = “”
txttotal = “”
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnik.SetFocus
End If
End Sub
Public Function terbilang(strangka As String, _
Optional matauang As String = “Rupiah”) As String
Dim strjmlhuruf$, intpecahan As Integer
Dim strpecahan$, urai$, bil1$, strtot$, bil2$
Dim x As Integer, y As Integer, z As Integer
On Error GoTo pesan
Dim strvalid As String, huruf As String * 1
Dim i As Integer
strvalid = “1234567890”
For i% = 1 To Len(strangka)
huruf = Chr(Asc(Mid(strangka, i%, 1)))
If InStr(strvalid, huruf) = 0 Then
Set angkaterbilang = Nothing
MsgBox “harus karakter angka”, vbCritical, “Karakter tidak vald”
Exit Function
End If
Next i%
If strangka = “” Then Exit Function
If Len(Trim(strangka)) > 15 Then GoTo pesan
strjmlhuruf = LTrim(strangka)
If (intpecahan = 0) Then
strpecahan = “”
Else
strpecahan = LTrim(Str(intpecahan)) + “/100 ”
End If
x = 0
y = 0
urai = “”
While (x < Len(strjmlhuruf))
x = x + 1
strtot = Mid(strjmlhuruf, x, 1)
y = y + Val(strtot)
z = Len(strjmlhuruf) – x + 1
Select Case Val(strtot)
Case 1
If (z = 1 Or z = 7 Or z = 10 Or z = 13) Then
bil1 = “Satu ”
ElseIf (z = 4) Then
If (x = 1) Then
bil1 = “Se”
Else
bil1 = “Satu ”
End If
ElseIf (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 11 Or z = 14) Then
x = x + 1
strtot = Mid(strjmlhuruf, x, 1)
z = Len(strjmlhuruf) – x + 1
bil2 = “”
Select Case Val(strtot)
Case 0: bil1 = “Sepuluh ”
Case 1: bil1 = “Sebelas ”
Case 2: bil1 = “Dua Belas ”
Case 3: bil1 = “Tiga Belas ”
Case 4: bil1 = “Empat Belas ”
Case 5: bil1 = “Lima Belas ”
Case 6: bil1 = “Enam Belas ”
Case 7: bil1 = “Tujuh Belas ”
Case 8: bil1 = “Delapan Belas ”
Case 9: bil1 = “Sembilan Belas ”
End Select
Else
bil1 = “Se”
End If
Case 2: bil1 = “Dua ”
Case 3: bil1 = “Tiga ”
Case 4: bil1 = “Empat ”
Case 5: bil1 = “Lima ”
Case 6: bil1 = “Enam ”
Case 7: bil1 = “Tujuh ”
Case 8: bil1 = “Delapan ”
Case 9: bil1 = “Sembilan ”
Case Else
bil1 = “”
End Select
If (Val(strtot) > 0) Then
If (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 14) Then
bil2 = “puluh ”
ElseIf (z = 3 Or z = 6 Or z = 9 Or z = 12 Or z = 15) Then
bil2 = “ratus ”
Else
bil2 = “”
End If
Else
bil2 = “”
End If
If (y > 0) Then
Select Case z
Case 4: bil2 = bil2 + “Ribu ”
y = 0
Case 7: bil2 = bil2 + “Juta ”
y = 0
Case 10: bil2 = bil2 + “Milyar ”
y = 0
Case 12: bil2 = bil2 + “Trilyun ”
y = 0
End Select
End If
urai = urai + bil1 + bil2
Wend
urai = urai + strpecahan
terbilang = (urai & matauang)
Exit Function
pesan:
terbilang = “(maksimal 15 digit)”
End Function
Private Sub Txttotal_Change()
txtterbilang.Text = terbilang(txttotal.Text)
End Sub

TIPE H

tipe h

Private Sub cbxkk_Click()
Select Case cbxkk.Text
Case “P205”
jenis = “Pentium II 500 Mega Hz”
harga = “1500000”
Case “P308”
jenis = “Pentium III 800 Mega Hz”
harga = “2100000”
Case “P310”
jenis = “Pentium III 1.0 Giga Hz ”
harga = “3500000”
Case “P415”
jenis = “Pentium IV 1.5 Giga Hz”
harga = “4000000”
Case “P417”
jenis = “Pentium IV 1.7 Giga Hz ”
harga = “4200000”
Case “P419”
jenis = “Pentium IV 1.9 Giga Hz”
harga = “5500000”

End Select
txtjj.SetFocus
txtjenis = jenis
txtharga = harga
End Sub

Private Sub cmdclose_Click()
Unload Me
End Sub

Private Sub cmdhitung_Click()
cbxkk = “Pilih Kode”
txtmerk = “”
txtharga = “”
txtjj = “”
txthp = “”
txtdis = “”
txttb = “”
txtjenis = “”
End Sub

Private Sub cmdprosess_Click()
txthp = Val(txtharga) * Val(txtjj)
If txthp > 40000000 Then
txtdis = Val(txthp) * 0.15
ElseIf txthp > 35000000 Then
txtdis = Val(txthp) * 0.1
ElseIf txthp > 30000000 Then
txtdis = Val(txthp) * 0.05
ElseIf txthp > 25000000 Then
txtdis = Val(txthp) * 0.02
End If
txttb = Val(txthp) – Val(txtdis)
End Sub

Private Sub Form_Load()
cbxkk.AddItem “P205”
cbxkk.AddItem “P308”
cbxkk.AddItem “P310”
cbxkk.AddItem “P415”
cbxkk.AddItem “P417”
cbxkk.AddItem “P419”

End Sub

Public Function terbilang(strangka As String, _
Optional matauang As String = “Rupiah”) As String
Dim strjmlhuruf$, intpecahan As Integer
Dim strpecahan$, urai$, bil1$, strtot$, bil2$
Dim x As Integer, y As Integer, z As Integer
On Error GoTo pesan
Dim strvalid As String, huruf As String * 1
Dim i As Integer
strvalid = “1234567890”
For i% = 1 To Len(strangka)
huruf = Chr(Asc(Mid(strangka, i%, 1)))
If InStr(strvalid, huruf) = 0 Then
Set angkaterbilang = Nothing
MsgBox “harus karakter angka”, vbCritical, “Karakter tidak vald”
Exit Function
End If
Next i%
If strangka = “” Then Exit Function
If Len(Trim(strangka)) > 15 Then GoTo pesan
strjmlhuruf = LTrim(strangka)
If (intpecahan = 0) Then
strpecahan = “”
Else
strpecahan = LTrim(Str(intpecahan)) + “/100 ”
End If
x = 0
y = 0
urai = “”
While (x < Len(strjmlhuruf))
x = x + 1
strtot = Mid(strjmlhuruf, x, 1)
y = y + Val(strtot)
z = Len(strjmlhuruf) – x + 1
Select Case Val(strtot)
Case 1
If (z = 1 Or z = 7 Or z = 10 Or z = 13) Then
bil1 = “Satu ”
ElseIf (z = 4) Then
If (x = 1) Then
bil1 = “Se”
Else
bil1 = “Satu ”
End If
ElseIf (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 11 Or z = 14) Then
x = x + 1
strtot = Mid(strjmlhuruf, x, 1)
z = Len(strjmlhuruf) – x + 1
bil2 = “”
Select Case Val(strtot)
Case 0: bil1 = “Sepuluh ”
Case 1: bil1 = “Sebelas ”
Case 2: bil1 = “Dua Belas ”
Case 3: bil1 = “Tiga Belas ”
Case 4: bil1 = “Empat Belas ”
Case 5: bil1 = “Lima Belas ”
Case 6: bil1 = “Enam Belas ”
Case 7: bil1 = “Tujuh Belas ”
Case 8: bil1 = “Delapan Belas ”
Case 9: bil1 = “Sembilan Belas ”
End Select
Else
bil1 = “Se”
End If
Case 2: bil1 = “Dua ”
Case 3: bil1 = “Tiga ”
Case 4: bil1 = “Empat ”
Case 5: bil1 = “Lima ”
Case 6: bil1 = “Enam ”
Case 7: bil1 = “Tujuh ”
Case 8: bil1 = “Delapan ”
Case 9: bil1 = “Sembilan ”
Case Else
bil1 = “”
End Select
If (Val(strtot) > 0) Then
If (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 14) Then
bil2 = “puluh ”
ElseIf (z = 3 Or z = 6 Or z = 9 Or z = 12 Or z = 15) Then
bil2 = “ratus ”
Else
bil2 = “”
End If
Else
bil2 = “”
End If
If (y > 0) Then
Select Case z
Case 4: bil2 = bil2 + “Ribu ”
y = 0
Case 7: bil2 = bil2 + “Juta ”
y = 0
Case 10: bil2 = bil2 + “Milyar ”
y = 0
Case 12: bil2 = bil2 + “Trilyun ”
y = 0
End Select
End If
urai = urai + bil1 + bil2
Wend
urai = urai + strpecahan
terbilang = (urai & matauang)
Exit Function
pesan:
terbilang = “(maksimal 15 digit)”
End Function
Private Sub Txttb_Change()
txtter.Text = terbilang(txttb.Text)
End Sub