tugas vb stok barang


Private Sub CMDBATAL_Click()
TXTKB.SetFocus
TXTKB.Text = “”
TXTNB.Text = “”
TXTJS.Text = “”
TXTTJ.Text = “”
TXTHJ.Text = “”
TXTTH.Text = “”
TXTSS.Text = “”

End Sub

Private Sub CMDKELUAR_Click()
Unload Me
End Sub

Private Sub CMDPROSES_Click()
Dim NM As String

NM = TXTKB.Text

If NM = “HT002S” Then
TXTNB.Text = “SOUND SISTEM”
TXTHJ.Text = “350000”
ElseIf NM = “HB002C” Then
TXTNB.Text = “COMPACT”
TXTHJ.Text = “480000”
ElseIf NM = “HB002T” Then
TXTNB.Text = “TAPE”
TXTHJ.Text = “275000”
End If
TXTJS.SetFocus
End Sub

Private Sub txtjs_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTTJ.SetFocus
End If
End Sub

Private Sub TXTTH_Click()
TXTTERBILANG.Text = TERBILANG(Val(TXTTH.Text))
End Sub

Private Sub TXTTJ_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim JS, TJ As Integer

TXTSS.Text = Val(TXTJS.Text) – Val(TXTTJ.Text)
TXTTH.Text = Val(TXTTJ.Text) * Val(TXTHJ.Text)
TXTTH.SetFocus
End If
End Sub

Iklan

 

Private Sub cmdbatal_Click()

txtkd.SetFocus

txtkd.Text = “”

txtnama.Text = “”

txtjumlah.Text = “”

txtsisa.Text = “”

txtterjual.Text = “”

txtharga.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub cmdproses_Click()

 

Dim A As String

A = txtkd.Text

 

If A = “HB002T” Then

txtnama.Text = “TAPE”

txtharga.Text = “275000”

 

ElseIf A = “HT002S” Then

txtnama.Text = “SOUND SYSTEM”

txtharga.Text = “350000”

 

ElseIf A = “HB002C” Then

txtnama.Text = “COMPACT”

txtharga.Text = “480000”

End If

 

txtjumlah.SetFocus

 

End Sub

 

 

Private Sub txtjumlah_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtsisa.SetFocus

End If

End Sub

 

 

Private Sub txtsisa_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtterjual.Text = Val(txtjumlah.Text) – Val(txtsisa.Text)

txttotal.Text = Val(txtterjual.Text) * Val(txtharga.Text)

End If

End Sub

 

 

TUGAS VISUAL BASIC 2 IRAWAN

private Sub CMDBATAL_Click()

TXTINPUT.SetFocus

TXTINPUT.Text = “”

TXTNIK.Text = “”

End Sub

Private Sub CMDEXIT_Click()

Unload Me

End Sub

Private Sub CMDLAGI_Click()

TXTINPUT.SetFocus

TXTGOLONGAN.Text = “”

TXTJABATAN.Text = “”

TXTTUNJANGAN.Text = “”

TXTGAPOK.Text = “”

TXTTOGA.Text = “”

TXTNIK.Text = “”

TXTTERBILANG.Text = “”

TXTBAGIAN.Text = “”

TXTTAHUN.Text = “”

TXTKODE.Text = “”

TXTSTATUS.Text = “”

End Sub

Private Sub CMDPROSES_Click()

Dim NIK As String

NIK = Left(TXTNIK.Text, 1)

If NIK = “A” Then

TXTGOLONGAN = “A”

TXTJABATAN = “MANAJER”

TXTTUNJANGAN = “625000”

TXTGAPOK = “2500000”

ElseIf NIK = “B” Then

TXTGOLONGAN = “B”

TXTJABATAN = “KA STAF”

TXTTUNJANGAN = “375000”

TXTGAPOK = “1500000”

ElseIf NIK = “C” Then

TXTGOLONGAN = “C”

TXTJABATAN = “STAF”

TXTTUNJANGAN = “250000”

TXTGAPOK = “1000000”

End If

TXTTOGA = Val(TXTGAPOK.Text) + Val(TXTTUNJANGAN.Text)

NIK = Mid(TXTNIK.Text, 2, 4)

TXTTAHUN.Text = NIK

NIK = Mid(TXTNIK.Text, 6, 3)

If NIK = “EDP” Then

TXTBAGIAN = “IT UNIT”

ElseIf NIK = “SDM” Then

TXTBAGIAN = “GENERAL AFFAIR”

ElseIf NIK = “ADM” Then

TXTBAGIAN = “ADMINISTRASI”

End If

NIK = Right(TXTNIK.Text, 1)

If NIK = “S” Then

TXTKODE = “S”

TXTSTATUS = “SINGLE”

ElseIf NIK = “M” Then

TXTKODE = “M”

TXTSTATUS = “MENIKAH”

ElseIf NIK = “D” Then

TXTKODE = “D”

TXTSTATUS = “DUDA”

ElseIf NIK = “J” Then

TXTKODE = “J”

TXTSTATUS = “JANDA”

End If

End Sub

Private Sub TXTTOGA_Change()

TXTTERBILANG.Text = terbilang(Val(TXTTOGA.Text))

End Sub

Private Function KeKata(Nomor)

TrjKata = Array(“”, “satu”, “dua”, “tiga”, “empat”, “lima”, “enam”, “tujuh”, “delapan”, “sembilan”)

KeKata = TrjKata(Nomor)

End Function

Public Function terbilang(Nilai_Angka, Optional Style = 4, Optional Satuan = “”)

Angka = Fix(Abs(Nilai_Angka))

des1 = Mid(Abs(Nilai_Angka), Len(Angka) + 2, 1)

des2 = Mid(Abs(Nilai_Angka), Len(Angka) + 3, 1)

If des2 = “” Then

If des1 = “” Or des1 = “0” Then

Koma = “”

Else

Koma = “koma” &KeKata(des1)

End If

ElseIf des2 = “0” Then

If des1 = “0” Then

Koma = “”

ElseIf des1 = “1” Then

Koma = “komasepuluh”

Else

Koma = “koma” &KeKata(des1) & “puluh”

End If

Else

If des1 = “0” Then

Koma = “komanol” &KeKata(des2)

ElseIf des1 = “1” Then

If des2 = “1” Then

Koma = “komasebelas”

Else

Koma = “koma” &KeKata(des2) & “belas”

End If

Else

Koma = “koma” &KeKata(des1) & “puluh” &KeKata(des2)

End If

End If

No1 = Left(Right(Angka, 1), 1)

No2 = Left(Right(Angka, 2), 1)

No3 = Left(Right(Angka, 3), 1)

No4 = Left(Right(Angka, 4), 1)

No5 = Left(Right(Angka, 5), 1)

No6 = Left(Right(Angka, 6), 1)

No7 = Left(Right(Angka, 7), 1)

No8 = Left(Right(Angka, 8), 1)

No9 = Left(Right(Angka, 9), 1)

No10 = Left(Right(Angka, 10), 1)

No11 = Left(Right(Angka, 11), 1)

No12 = Left(Right(Angka, 12), 1)

No13 = Left(Right(Angka, 13), 1)

No14 = Left(Right(Angka, 14), 1)

No15 = Left(Right(Angka, 15), 1)

If Len(Angka) >= 1 Then

If Len(Angka) = 1 And No1 = 1 Then

Nomor1 = “satu”

ElseIfLen(Angka) = 1 And No1 = 0 Then

Nomor1 = “Nol”

ElseIf No2 = “1” Then

If No1 = “1” Then

Nomor1 = “sebelas”

ElseIf No1 = “0” Then

Nomor1 = “sepuluh”

Else

Nomor1 = KeKata(No1) & “belas”

End If

Else

Nomor1 = KeKata(No1)

End If

Else

Nomor1 = “”

End If

If Len(Angka) >= 2 Then

If No2 = 1 Or No2 = “0” Then

Nomor2 = “”

Else

Nomor2 = KeKata(No2) & “puluh”

End If

Else

Nomor2 = “”

End If

If Len(Angka) >= 3 Then

If No3 = “1” Then

Nomor3 = “seratus”

ElseIf No3 = “0” Then

Nomor3 = “”

Else

Nomor3 = KeKata(No3) & “ratus”

End If

Else

Nomor3 = “”

End If

If Len(Angka) >= 4 Then

If No6 = “0” And No5 = “0” And No4 = “0” Then

Nomor4 = “”

ElseIf (No4 = “1” And Len(Angka) = 4) Or (No6 = “0” And No5 = “0” And No4 = “1”) Then

Nomor4 = “seribu ”

ElseIf No5 = “1” Then

If No4 = “1” Then

Nomor4 = “sebelasribu”

ElseIf No4 = “0” Then

Nomor4 = “sepuluhribu”

Else

Nomor4 = KeKata(No4) & “belasribu”

End If

Else

Nomor4 = KeKata(No4) & “ribu”

End If

Else

Nomor4 = “”

End If

If Len(Angka) >= 5 Then

If No5 = “1” Or No5 = “0” Then

Nomor5 = “”

Else

Nomor5 = KeKata(No5) & “puluh”

End If

Else

Nomor5 = “”

End If

If Len(Angka) >= 6 Then

If No6 = “1” Then

Nomor6 = “seratus”

ElseIf No6 = “0” Then

Nomor6 = “”

Else

Nomor6 = KeKata(No6) & “ratus”

End If

Else

Nomor6 = “”

End If

If Len(Angka) >= 7 Then

If No9 = “0” And No8 = “0” And No7 = “0” Then

Nomor7 = “”

ElseIf No7 = “1” And Len(Angka) = 7 Then

Nomor7 = “satujuta”

ElseIf No8 = “1” Then

If No7 = “1” Then

Nomor7 = “sebelasjuta”

ElseIf No7 = “0” Then

Nomor7 = “sepuluhjuta”

Else

Nomor7 = KeKata(No7) & “belasjuta”

End If

Else

Nomor7 = KeKata(No7) & “juta”

End If

Else

Nomor7 = “”

End If

If Len(Angka) >= 8 Then

If No8 = “1” Or No8 = “0” Then

Nomor8 = “”

Else

Nomor8 = KeKata(No8) & “puluh”

End If

Else

Nomor8 = “”

End If

If Len(Angka) >= 9 Then

If No9 = “1” Then

Nomor9 = “seratus”

ElseIf No9 = “0” Then

Nomor9 = “”

Else

Nomor9 = KeKata(No9) & “ratus”

End If

Else

Nomor9 = “”

End If

If Len(Angka) >= 10 Then

If No12 = “0” And No11 = “0” And No10 = “0” Then

Nomor10 = “”

ElseIf No10 = “1” And Len(Angka) = 10 Then

Nomor10 = “satumilyar”

ElseIf No11 = “1” Then

If No10 = “1” Then

Nomor10 = “sebelasmilyar”

ElseIf No10 = “0” Then

Nomor10 = “sepuluhmilyar”

Else

Nomor10 = KeKata(No10) & “belasmilyar”

End If

Else

Nomor10 = KeKata(No10) & “milyar”

End If

Else

Nomor10 = “”

End If

If Len(Angka) >= 11 Then

If No11 = “1” Or No11 = “0” Then

Nomor11 = “”

Else

Nomor11 = KeKata(No11) & “puluh”

End If

Else

Nomor11 = “”

End If

If Len(Angka) >= 12 Then

If No12 = “1” Then

Nomor12 = “seratus”

ElseIf No12 = “0” Then

Nomor12 = “”

Else

Nomor12 = KeKata(No12) & “ratus”

End If

Else

Nomor12 = “”

End If

If Len(Angka) >= 13 Then

If No15 = “0” And No14 = “0” And No13 = “0” Then

Nomor13 = “”

ElseIf No13 = “1” And Len(Angka) = 13 Then

Nomor13 = “satutriliun”

ElseIf No14 = “1” Then

If No13 = “1” Then

Nomor13 = “sebelastriliun”

ElseIf No13 = “0” Then

Nomor13 = “sepuluhtriliun”

Else

Nomor13 = KeKata(No13) & “belastriliun”

End If

Else

Nomor13 = KeKata(No13) & “triliun”

End If

Else

Nomor13 = “”

End If

If Len(Angka) >= 14 Then

If No14 = “1” Or No14 = “0” Then

Nomor14 = “”

Else

Nomor14 = KeKata(No14) & “puluh”

End If

Else

Nomor14 = “”

End If

If Len(Angka) >= 15 Then

If No15 = “1” Then

Nomor15 = “seratus”

ElseIf No15 = “0” Then

Nomor15 = “”

Else

Nomor15 = KeKata(No15) & “ratus”

End If

Else

Nomor15 = “”

End If

If Len(Angka) >= 15 Then

bilang = “Digit AngkaTerlaluBanyak”

Else

If IsNull(Nilai_Angka) Then

bilang = “”

ElseIfNilai_Angka<= 0 Then

bilang = “minus” & Trim(Nomor15 & Nomor14 & Nomor13 & Nomor12 & Nomor11 & Nomor10 & Nomor9 & Nomor8 & Nomor7 _

& Nomor6 & Nomor5 & Nomor4 & Nomor3 & Nomor2 & Nomor1 &Koma& “” &Satuan)

Else

bilang = Trim(Nomor15 & Nomor14 & Nomor13 & Nomor12 & Nomor11 & Nomor10 & Nomor9 & Nomor8 & Nomor7 _

& Nomor6 & Nomor5 & Nomor4 & Nomor3 & Nomor2 & Nomor1 &Koma& “” &Satuan)

End If

End If

If Style = 4 Then

terbilang = StrConv(Left(bilang, 1), 1) &StrConv(Mid(bilang, 2, 1000), 2)

Else

terbilang = StrConv(bilang, Style)

End If

terbilang = Replace(terbilang, ” “, ” “, 1, 1000, vbTextCompare)

End Function

listning Program

 

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
Txtkt.SetFocus
Txtkt.Text = “”
txtht.Text = “”
txtjk.Text = “”
txtjb.Text = “”
txtjt.Text = “”
txttotalp.Text = “”
End Sub
Private Sub Form_Activate()
Txtkt.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim b As String
Dim a, c, s As Variant
s = Left(Txtkt.Text, 3)
a = Val(txtht.Text)
If s = “bim” Then
b = “bima”
a = “50000”
c = “16:00”
ElseIf s = “eko” Then
b = “ekonomi”
a = “35000”
c = “19:00”
ElseIf s = “mut” Then
b = “mutiara”
a = “23000”
c = “17:00”
ElseIf s = “sen” Then
b = “senja”
a = “15000”
c = “20:00”
End If
txtht.Text = a
txtjk.Text = b
txtjb.Text = c
txtjt.SetFocus
End Sub

Private Sub txtht_Change()

End Sub

Private Sub txtjt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim tp, ht, jt As Integer
ht = Val(txtht.Text)
jt = Val(txtjt.Text)
tp = Val(txtht.Text) * (txtjt.Text)
txttotalp.Text = tp
cmdlagi.SetFocus
End If
End Sub

Private Sub Txtkt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdproses.SetFocus
End If
End Sub

DATA KODE PROGRAM

 

“DATA KODE UNTUK CHECK TEBAL”

Private Sub chkbold_Click()

If chkbold.Value = 1 Then

lbllencir.FontBold = True

Else

lbllencir.FontBold = False

End If

End Sub

 

“DATA KODE UNTUK CHECK GARIS MIRING”

Private Sub chkitalic_Click()

If chkitalic.Value = 1 Then

lbllencir.FontItalic = True

Else

lbllencir.FontItalic = False

End If

End Sub

 

“DATA KODE UNTUK CHECK GARIS TENGAH”

Private Sub chkstrike_Click()

If chkstrike.Value = 1 Then

lbllencir.FontStrikethru = True

Else

lbllencir.FontStrikethru = False

End If

End Sub

 

“DATA KODE UNTUK CHECK GARIS BAWAH”

Private Sub chkUnder_Click()

If chkUnder.Value = 1 Then

lbllencir.FontUnderline = True

Else

lbllencir.FontUnderline = False

End If

End Sub

 

“DATA KODE UNTUK CMD  KELUAR”

Private Sub cmdmetu_Click()

End

End Sub

 

“DATA KODE UNTUK OPTION WARNA MERAH”

Private Sub optabang_Click()

lbllencir.ForeColor = vbRed

End Sub

 

“DATA KODE UNTUK OPTION WARNA BIRU”

Private Sub optbiru_Click()

lbllencir.ForeColor = vbBlue

End Sub

“DATA KODE UNTUK OPTION WARNA HIJAU”

Private Sub optijo_Click()

lbllencir.ForeColor = vbGreen

End Sub

 

“DATA KODE UNTUK OPTION WARNA HITAM”

Private Sub optireng_Click()

lbllencir.ForeColor = vbBlack

End Sub

 

“KODE UNTUK OPTION WARNA KUNING”

Private Sub optkuning_Click()

lbllencir.ForeColor = vbYellow

End Sub

 

DATA KODE PROGRAM

 

 

“KODE UNTUK CMD BERSIH”

Private Sub CmdBersih_Click()

txtbil1.Text = “”

txtbil2.Text = “”

Txthasil.Text = “”

End Sub

 

“KODE UNTUK CMD KELUAR”

Private Sub cmdexit_Click()

End

End Sub

 

“KODE UNTUK CMD HITUNG”

Private Sub cmdHitung_Click()

Txthasil.Text = Val(txtbil1.Text) * (txtbil2.Text)

End Sub

 

Private Sub txtbil1_Change()

 

End Sub

 

DATA KODE PROGRAM

 

 

“KODE UNTUK CMD BERSIH”

Private Sub Cmdbersih_Click()

TXTKT.Text = “”

TXTHT.Text = “”

txtJp.Text = “”

TXTJB.Text = “”

TXTJT.Text = “”

TXTAP.Text = “”

End Sub

 

“KODE UNTUK CMD KELUAR”

Private Sub CMDEXIT_Click()

End

End Sub

 

“KODE UNTUK CMD HITUNG”

Private Sub cmdhitung_Click()

TXTAP.Text = Val(TXTHT.Text) * (TXTJT.Text)

End Sub

 

 

 

“KODE UNTUK CMD LAGI”

Private Sub CMDLAGI_Click()

TXTKT.SetFocus

TXTKT.Text = “”

TXTHT.Text = “”

txtJp.Text = “”

TXTJB.Text = “”

TXTJT.Text = “”

End Sub

 

Private Sub TXTHT_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtJp.SetFocus

End If

End Sub

 

Private Sub TXTJB_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTJT.SetFocus

End If

End Sub

 

Private Sub txtJp_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTJB.SetFocus

End If

End Sub

 

Private Sub TXTJT_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTAP.Text = Val(TXTHT.Text) * (TXTJT.Text)

End If

End Sub

 

Private Sub TXTKT_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTHT.SetFocus

End If

End Sub

 

Private Sub Txtred_Change()

Txtred.ForeColor = vbRed

End Sub

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.