vb

0

Gambar

Private Sub cmdbatal_Click()
txtnama.SetFocus
txtnama.Text = “”
txtnpm.Text = “”
txtjurusan.Text = “”
txtstudi.Text = “”
txttahun.Text = “”
txtno = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
txtnama.SetFocus
txtnama.Text = “”
txtjurusan.Text = “”
txtstudi.Text = “”
txttahun.Text = “”
txtno = “”

 

End Sub

 

Private Sub Command2_Click()
Data1.Recordset.Update
End Sub

Private Sub cmdproses_Click()
Dim s As Integer

txttahun.Text = “20″ & Left(txtnpm.Text, 2)

s = Mid(txtnpm.Text, 3, 1)

If s = “1″ Then
txtjurusan.Text = “sistem informasi”
ElseIf s = “2″ Then
txtjurusan.Text = “manajement informatika”
ElseIf s = “3″ Then
txtjurusan.Text = “tekhnik informatika”
ElseIf s = “4″ Then
txtjurusan.Text = “manajement& kom.akutansi”
End If

s = Mid(txtnpm.Text, 4, 2)

If s = “01″ Then
txtstudi.Text = “strata satu”
ElseIf s = “02″ Then
txtstudi.Text = “diploma tiga”
ElseIf s = “03″ Then
txtstudi.Text = “diploma empat”
ElseIf s = “04″ Then
txtstudi.Text = “diploma dua”
End If
txtno.Text = Right(txtnpm.Text, 3)
End Sub

Private Sub Command1_Click()
Data1.Recordset.AddNew
End Sub

Private Sub Form_Activate()
txtnama.SetFocus
End Sub

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

tugasvb

0

Gambar

  • Batal

Private Sub cmdbatal_Click()
txtnama.SetFocus
txtnama.Text = “”
txtnpm.Text = “”
txtkelas.Text = “”
txtjurus.Text = “”
txtpro.Text = “”
txttahun.Text = “”
txtno.Text = “”
txtdaftar.Text = “”
txtbiaya.Text = “”
txtbangun.Text = “”
txtpropti.Text = “”
txttotal.Text = “”
End Sub

  • Lagi

Private Sub cmdlagi_Click()
txtnama.SetFocus
txtnama.Text = “”
txtnpm.Text = “”
txtkelas.Text = “”
txtjurus.Text = “”
txtpro.Text = “”
txttahun.Text = “”
txtno.Text = “”
txtdaftar.Text = “”
txtbiaya.Text = “”
txtbangun.Text = “”
txtpropti.Text = “”
txttotal.Text = “”
End Sub

Private Sub Form_Activate()
txtnama.SetFocus
End Sub

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

  • Keluar

Private Sub cmdkeluar_Click()
End
End Sub

  • Proses

Private Sub cmdproses_Click()
Dim a, b As String

a = Left(txtnpm.Text, 1)
If a = “E” Or a = “e” Then
txtkelas.Text = “Eksekutif”
txtbangun.Text = “1250000″
ElseIf a = “R” Or a = “r” Then
txtkelas.Text = “Reguler”
txtbangun.Text = “1000000″
End If

txtpropti.Text = “600000″

a = Mid(txtnpm.Text, 5, 1)
If a = “1″ Then
txtjurus.Text = “Sistem Informasi”
ElseIf a = “2″ Then
txtjurus.Text = “Manajemen Informatika”
ElseIf a = “3″ Then
txtjurus.Text = “Manajemen dan Komp.Akutansi”
End If

a = Mid(txtnpm.Text, 6, 2)
If a = “01″ Then
txtpro.Text = “Strata Satu”
txtdaftar.Text = “200000″
ElseIf a = “02″ Then
txtpro.Text = “Diploma Tiga”
txtdaftar.Text = “150000″
ElseIf a = “03″ Then
txtpro.Text = “Diploma Satu”
txtdaftar.Text = “150000″
End If
txtno.Text = Right(txtnpm.Text, 3)

txttahun.Text = “20″ & Mid(txtnpm.Text, 3, 2)

If txtkelas.Text = “Eksekutif” And txtpro.Text = “Strata Satu” Then
txtbiaya.Text = “1900000″
ElseIf txtkelas.Text = “Eksekutif” And txtpro.Text = “Diploma Tiga” Then
txtbiaya.Text = “1650000″
ElseIf txtkelas.Text = “Eksekutif” And txtpro.Text = “Diploma Satu” Then
txtbiaya.Text = “1350000″
ElseIf txtkelas.Text = “Reguler” And txtpro.Text = “Strata Satu” Then
txtbiaya.Text = “1500000″
ElseIf txtkelas.Text = “Reguler” And txtpro.Text = “Diploma Tiga” Then
txtbiaya.Text = “1250000″
ElseIf txtkelas.Text = “Reguler” And txtpro.Text = “Diploma Satu” Then
txtbiaya.Text = “1250000″
End If

txttotal.Text = Val(txtdaftar.Text) + Val(txtbiaya.Text) + Val(txtbangun.Text) + Val(txtpropti.Text)

End Sub

 

 

 

tugas vb

0

 

 

Private Sub Form_Activate()

 

Dim c As Integer

c = 1

Do While c < 20

c = c + 2

List1.AddItem c

Loop

 

Dim a As Integer

a = 0

Do While a < 20

a = a + 2

List2.AddItem a

Loop

 

Dim b As Integer

For b = 5 To 499 Step 27

List3.AddItem b + 3

Next b

End Sub

 Gambar

 

 

Tugas Visual Basic :)

0

Nama         : Ines Purnama Sari

NPM           : 12100036

 

ENTRI PENJUALAN LAPTOP APPLE

Gambar

 

  • Code untuk Command Proses

Private Sub cmdproses_Click()

Dim penjualan, discount, kode, merk, bayar, a, b As String

Dim harga As Variant

kode = Mid(cbokode.Text, 7, 5)

If kode = “MC965” Then

merk = “Apple MacBook Air MC965”

harga = “12800000”

ElseIf kode = “MC966” Then

merk = “Apple MacBook Air MC966”

harga = “15800000”

ElseIf kode = “MC968” Then

merk = “Apple MacBook Air MC968”

harga = “9900000”

ElseIf kode = “MC969” Then

merk = “Apple MacBook Air MC969”

harga = “11900000”

ElseIf kode = “MC700” Then

merk = “Apple MacBook Air MC700”

harga = “10800000”

ElseIf kode = “MC721” Then

merk = “Apple MacBook Air MC721?”

harga = “15900000”

ElseIf kode = “MC723” Then

merk = “Apple MacBook Air MC723?”

harga = “19300000”

ElseIf kode = “MC724” Then

merk = “Apple MacBook Air MC724?”

harga = “13700000”

ElseIf kode = “MC311” Then

merk = “Apple MacBook Air MC311”

harga = “24200000”

ElseIf kode = “MC313” Then

merk = “Apple MacBook Air MC313”

harga = “11900000”

ElseIf kode = “MC314” Then

merk = “Apple MacBook Air MC314”

harga = “14700000”

ElseIf kode = “MC318” Then

merk = “Apple MacBook Air MC318”

harga = “17600000”

ElseIf kode = “MC322” Then

merk = “Apple MacBook Air MC322”

harga = “21300000”

ElseIf kode = “MC965” Then

merk = “Apple MacBook Air MC965”

harga = “12800000”

ElseIf kode = “MC966” Then

merk = “Apple MacBook Air MC966”

harga = “15800000”

End If

txtmerk.Text = merk

txths.Text = harga

a = Val(txtjj.Text)

b = Val(txths.Text)

penjualan = a * b

txthp.Text = penjualan

Select Case txthp.Text

Case Is > 140000000

discount = 0.15 * penjualan

Case Is > 135000000

discount = 0.1 * penjualan

Case Is > 130000000

discount = 0.05 * penjualan

Case Is > 125000000

discount = 0.02 * penjualan

End Select

penjualan = Val(txthp.Text)

txtdis.Text = discount

txttb.Text = Val(txthp.Text) – Val(txtdis.Text)

End Sub

 

  • code untuk Cammond Lagi

Private Sub cmdlagi_Click()

cbokode.SetFocus

cbokode.Text = “”

txtmerk.Text = “”

txths.Text = “”

txtjj.Text = “”

txtdis.Text = “”

txttb.Text = “”

txthp.Text = “”

End Sub

 

 

  • Code untuk Form Load

Private Sub Form_Load()

cbokode.AddItem “Apple MC965 MasBook Air”

cbokode.AddItem “Apple MC966 MasBook Air”

cbokode.AddItem “Apple MC968 MasBook Air”

cbokode.AddItem “Apple MC969 MasBook Air”

cbokode.AddItem “Apple MC700 MasBook Pro”

cbokode.AddItem “Apple MC721 MasBook Pro”

cbokode.AddItem “Apple MC723 MasBook Pro”

cbokode.AddItem “Apple MC724 MasBook Pro”

cbokode.AddItem “Apple MC311 MasBook Pro”

cbokode.AddItem “Apple MC313 MasBook Pro”

cbokode.AddItem “Apple MC314 MasBook Pro”

cbokode.AddItem “Apple MC318 MasBook Pro”

cbokode.AddItem “Apple MC322 MasBook Pro”

cbokode.AddItem “Apple MC965 MasBook Air”

cbokode.AddItem “Apple MC966 MasBook Air”

End Sub

 

  • Code untuk Command Keluar

Private Sub cmdkeluar_Click()

End

End Sub

 

 

PT. PULANG PETANG SETIAP HARI

Gambar

  • Code untuk Command Proses

Private Sub cmdproses_click()

Dim NIK As String

NIK = Mid(txtNIK.Text, 5, 1)

If NIK = “A” Then

Txtgol = “A”

Txtjabatan.Text = “MANAJER”

Txtgapok.Text = “3.000.000”

Txttj.Text = “875000”

ElseIf NIK = “B” Then

Txtgol = “B”

Txtjabatan.Text = “KA SEKSI”

Txtgapok.Text = “2.500.000”

Txttj.Text = “525000”

ElseIf NIK = “C” Then

Txtgol.Text = “C”

Txtjabatan.Text = “staff”

Txtgapok.Text = “2.000.000”

Txttj.Text = “325000”

End If

NIK = Left(txtNIK.Text, 4)

Txttahun.Text = NIK

NIK = Mid(txtNIK.Text, 7, 1)

If NIK = “S” Then

Txtks.Text = “S”

Txtstatus.Text = “single”

ElseIf NIK = “M” Then

Txtks.Text = “M”

Txtstatus.Text = “menikah”

ElseIf NIK = “J” Then

Txtks.Text = “J”

Txtstatus.Text = “janda”

ElseIf NIK = “D” Then

Txtks.Text = “D”

Txtstatus.Text = “duda”

End If

NIK = Right(txtNIK.Text, 3)

If NIK = “ADM” Then

Txtbagian.Text = “ADMINISTRASI”

ElseIf NIK = “KEU” Then

Txtbagian.Text = “ACOUNTING”

ElseIf NIK = “SDM” Then

Txtbagian.Text = “GENERAL AFFAIR”

ElseIf NIK = “SPM” Then

Txtbagian.Text = “SECURITY”

ElseIf NIK = “EDF” Then

Txtbagian.Text = “IT UNIT”

End If

txttg.Text = Val(Txtgapok.Text) + Val(Txttj.Text)

End Sub

 

  • Code untuk Command Batal

Private Sub Cmdbatal_Click()

Unload Me

End Sub

  • Code untuk Command Lagi

Private Sub Cmdlagi_Click()

Txtgol = “”

Txtks = “”

Txtstatus = “”

Txttahun = “”

Txtjabatan = “”

Txtbagian = “”

Txtgapok = “”

Txttj = “”

txttg = “”

End Sub

 

  •  Code untuk Command Keluar

Private Sub Cmdkeluar_Click()

End

End Sub

 

Tugas Visual Basic

0

Gambar

 

  • KODE UNTUK COMMAND PROSES

Private Sub CMDPROSES_Click()

Dim KT, JK, HT, JB As String

KT = Left(TXTKT.Text, 7)

If KT = “BIM” Then

TXTJK.Text = “BIMA”

TXTHT.Text = “50000”

TXTJB.Text = “16.00”

ElseIf KT = “EKO” Then

TXTJK.Text = “EKONOMI”

TXTHT.Text = “35000”

TXTJB.Text = “19.00”

ElseIf KT = “MUT” Then

TXTJK.Text = “MUTIARA”

TXTHT.Text = “23000”

TXTJB.Text = “17.00”

ElseIf KT = “SEN” Then

TXTJK.Text = “SENJA”

TXTHT.Text = “15000”

TXTJB.Text = “20.00”

End If

JUMLAH = TXTJT.Text

TXTJT.SetFocus

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

TXTTOTALP.SetFocus

End Sub

 

  • KODE UNTUK COMMAND LAGI

Private Sub CMDLAGI_Click()

TXTKT.Text = “”

TXTHT.Text = “”

TXTJK.Text = “”

TXTJB.Text = “”

TXTJT.Text = “”

TXTTOTALP.Text = “”

End Sub

 

  • KODE UNTUK COMMAND KELUAR

Private Sub CMDKELUAR_Click()

End

End Sub

 

selamat Mencoba 🙂

 

 

 

Tugas Visual Basic

0
  1.  Perkalian Dua Bilangan 

INES

 

  • Code untuk  membuat Command Bersih

Private Sub cmdbersih_Click()

txtbil1.Text = “”

txtbil2.Text = “”

txthasil.Text = “”

End Sub

  • Code untuk  Membuat Command Hitung

Private Sub cmdhitung_Click()

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

End Sub

  • Code untuik Membuat Command Keluar

Private Sub cmdkeluar_Click()

Unload Me

End Sub

CODE1

Selamat mencoba ya !!!!   🙂

 

 2. Font Color And Font Style Microsoft Visual Basic 6.0

ines2

  • Code untuk membuat font style  check Bold

Private Sub chkbold_Click()

If chkbold.Value = 1 Then

lbl1.FontBold = True

Else

lbl1.FontBold = False

End If

End Sub

 

  • Code untuk Membuat font style Check Italic

Private Sub chkitalic_Click()

If chkitalic.Value = 1 Then

lbl1.FontItalic = True

Else

lbl1.FontItalic = False

End If

End Sub

 

  • Code untuk membuat font style check Strikeout

Private Sub chkstrikeout_Click()

If chkstrikeout.Value = 1 Then

lbl1.Fontstrikeout = True

Else

lbl1.Fontstrikeout = False

End If

End Sub

 

  • Code untuk membuat font style check underline

Private Sub chkunderline_Click()

If chkunderline.Value = 1 Then

lbl1.FontUnderline = True

Else

lbl1.FontUnderline = False

End If

End Sub

 

 

  • Code untuk membuat Command Exit

Private Sub cmdexit_Click()

Unload Me

End Sub

 

 

  • Code untuk membuat font color Option Blue

Private Sub optblue_Click()

lbl1.ForeColor = vbBlue

End Sub

 

  • Code untuk membuat font color Option Green

Private Sub optgreen_Click()

lbl1.ForeColor = vbGreen

End Sub

 

  • Code untuk membuat font color Option Red

Private Sub optred_Click()

lbl1.ForeColor = vbRed

 

End Sub

 

  • Code untuk membuat font color Option yellow

Private Sub optyellow_Click()

lbl1.ForeColor = vbYellow

End Sub

CODE2

 

Selamat Mencoba, Semoga Berhasil !!!!! 🙂

 

3.  Perhitungan harga setelah Diskon 10%

INES3

  • code untuk membuat command Hitung

Private Sub cmdhitung_Click()

txtdiskon.Text = Val(txthawal.Text) * 0.1

txthakhir.Text = Val(txthawal.Text) – Val(txtdiskon.Text)

End Sub

 

  • code untuk membuat Command Quit

Private Sub cmdquit_Click()

Unload Me

End Sub

 

  • cara untuk membuat Command Ulangi

Private Sub cmdulangi_Click()

txthawal = “”

txtdiskon = “”

txthakhir = “”

End Sub

CODE3

 

 

Selamat mencoba,, Semoga Berhasil !!!! 🙂

 

 4. Aplikasi Perhitungan Gaji

ines4

  • code untuk membuat Command Keluar

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

  • code untuk membuat Command Ulang

Private Sub cmdulang_Click()

txtgapok = “”

txttunjangan = “”

txtpot = “”

txtgator = “”

txtgama = “”

End Sub

 

  • code Untuk membuat Enter

Private Sub txtgapok_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttunjangan.SetFocus

End If

End Sub

 

  • code Untuk membuat Enter

Private Sub txttunjangan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtpot.SetFocus

End If

End Sub

CODE FROM4

 

Selamat mencoba,, semoga Berhasil !! 🙂

 

 5. Huruf Mutu Mahasiswa STMIK Pringsewu

INES5

  • Code untuk Membyat Combo

Private Sub cbonpm_Click()

Select Case cbonpm.Text

Case “12100036”

nama = “Ines Purnama Sari”

jurusan = “Sistem Informasi”

Case “12100038”

nama = “Agusta Hendri Yarti”

jurusan = “Sistem Informasi”

Case “12100039”

nama = “Sinta Umpusinga”

jurusan = “Sistem Informasi”

End Select

txtnma.Text = nama

txtjrs.Text = jurusan

txtnq.SetFocus

End Sub

 

  • Code untuk membuat Command Batal

Private Sub cmdbatal_Click()

cbonpm.SetFocus

cbonpm.Text = “”

txtnma.Text = “”

txtjrs.Text = “”

txtnq.Text = “”

txtnt.Text = “”

txtuts.Text = “”

txtuas.Text = “”

txtna.Text = “”

txthm.Text = “”

End Sub

 

 

  • Code untuk membuat Command Keluar

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

  • Code untuk membuat Command Proses

Private Sub cmdproses_Click()

quis = Val(txtnq.Text)

tugas = Val(txtnt.Text)

uts = Val(txtuts.Text)

uas = Val(txtuas.Text)

NA = (quis + tugas + uts + uas) / 4

txtna.Text = NA

 

Select Case txtna.Text

Case Is > 80

HM = “A”

Select Case txtna.Text

Case Is > 70

HM = “B”

Select Case txtna.Text

Case Is > 60

HM = “C”

Select Case txtna.Text

Case Is > 50

HM = “D”

Select Case txtna.Text

Case Is < 50

HM = “E”

End Select

txthm.Text = HM

End Sub

 

  • Code untuk membuat Form Load

Private Sub Form_Load()

cbonpm.AddItem “12100036”

cbonpm.AddItem “12100038”

cbonpm.AddItem “12100039”

 

End Sub

 

 

  • Code membuat Enter

Private Sub txtnq_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnt.SetFocus

End If

End Sub

 

  • Code membuat Enter

Private Sub txtnt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtuts.SetFocus

End If

End Sub

 

 

  • Code membuat Enter

Private Sub txtuts_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtuas.SetFocus

End If

End Sub

CODE FROM5

selamatt mencoba,, semoga berhasill…  🙂

Terima kasih… 🙂 😉 (y)

 

 

 

 

Tugas Visual Basic Part II

0

 

1. Kode Buah :

Private Sub txtkb_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnb.SetFocus

End If

End Sub

2. Nama Buah :

Private Sub txtnb_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txthb.SetFocus

End If

End Sub

3. Harga Buah :

Private Sub txthb_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtjb.SetFocus

End If

End Sub

4. Jumlah Beli :

Private Sub txtjb_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttb.Text = Val(txthb.Text) * (txtjb.Text)

End If

End Sub

5. Total Bayar :

Private Sub txttb_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

End If

End Sub

 

6. Lagi :

Private Sub cmdlagi_Click()

txtkb.SetFocus

txtkb = “”

txtnb = “”

txthb = “”

txtjb = “”

txttb = “”

End Sub

 

7. Batal :

Private Sub cmdbatal_Click()

txtkb.SetFocus

txtkb = “”

txtnb = “”

txthb = “”

txtjb = “”

txttb = “”

End Sub

8. Keluar :

Private Sub cmdkeluar_Click()

End

End Sub