Minggu, 04 Desember 2011

Program Visual Basic Login

Posted by Unknown On Minggu, Desember 04, 2011 | No comments
Tampilan :


Tabel User/Database:


Untuk Menampilakan DBGrid : Klik Kanan Pada Toolbox Kemudian Pilih Components Kemudian Pilih Microsoft Data Bound Grid Contorl 5.0(SP3)


Listing/Coding :


Option Explicit

Private Sub cmdlogin_Click()
On Error GoTo a
Data1.Recordset.Index = "xuser"
Data1.Recordset.Seek "=", txtuser
If Data1.Recordset!Password <> txtpass Then
MsgBox "Anda Salah Memasukkan Password", , "Info"
Else
Me.Hide
File_Master.Show
End If
Exit Sub
a:
MsgBox "Data Tidak Ada", , "Info"
txtuser.Text = ""
txtpass.Text = ""
End Sub

Private Sub cmdkeluar_Click()
Dim x As String
x = MsgBox("Are Your Sure To Exit..?!?", vbQuestion + vbYesNoCancel, "Informasi")
If x = vbYes Then
End
End If
End Sub

Senin, 14 November 2011

Program Lanjutan Visual Basic 2

Posted by Unknown On Senin, November 14, 2011 | No comments


Untuk Menampilakan DBGrid : Klik Kanan Pada Toolbox Kemudian Pilih Components Kemudian Pilih Microsoft Data Bound Grid Contorl 5.0(SP3)

Untuk Menampilkan DBCombo : Klik Kanan Pada Toolbox Kemudian Pilih Components Kemudian Pilih Microsoft Data Bound List Controls 6.0(OLEDB)

Untuk Listing Bisa Download Disini, Semoga Bermanfaat Bagi Semua...!! :D

Program Lanjutan Visual Basic

Posted by Unknown On Senin, November 14, 2011 | No comments

Untuk Menambahkan Objek DBGrid : Klik Kanan Pada Toolbox kemudian pilih Components kemudian pilih Microsoft Data Bound Grid Control 5.0(SP3)


Untung Listingnya bisa Download Disini, Selamat Mencoba...!! :D

Kamis, 03 November 2011

Program Visual Basic Restoran

Posted by Unknown On Kamis, November 03, 2011 | No comments

Sintaknya :

Sub nonaktif()
Option1.Enabled = False
Option2.Enabled = False
Option3.Enabled = False
Option4.Enabled = False
Option5.Enabled = False
Option6.Enabled = False
txtmakan1.Enabled = False
txtmakan2.Enabled = False
txtminum.Enabled = False
txtharga.Enabled = False
txtjumbel.Enabled = False
txttotal.Enabled = False
txtdiskon.Enabled = False
txttobay.Enabled = False
txtbayar.Enabled = False
txtkembali.Enabled = False
txtditempat.Enabled = False
txtdelivery.Enabled = False
End Sub

Sub aktif()
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
Option4.Enabled = True
Option5.Enabled = True
Option6.Enabled = True
txtmakan1.Enabled = True
txtmakan2.Enabled = True
txtminum.Enabled = True
txtharga.Enabled = True
txtjumbel.Enabled = True
txttotal.Enabled = True
txtdiskon.Enabled = True
txttobay.Enabled = True
txtbayar.Enabled = True
txtkembali.Enabled = True
txtditempat.Enabled = True
txtdelivery.Enabled = True
End Sub

Private Sub exit_Click()
x = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Confrimasi")
If x = vbYes Then
End
End If
End Sub

Private Sub new_Click()
nonaktif
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
txtmakan1.Text = " "
txtmakan2.Text = " "
txtminum.Text = " "
txtharga.Text = " "
txtditempat.Text = " "
txtdelivery.Text = " "
txtjumbel.Text = " "
txttotal.Text = " "
txtdiskon.Text = " "
txttobay.Text = " "
txtbayar.Text = " "
txtkembali.Text = " "
End Sub

Private Sub start_Click()
aktif
End Sub

Private Sub Timer1_Timer()
tanggal.Caption = Format(date, "dddd, d mmmm yyyy")
waktu.Caption = Format(time, "hh:mm:ss")
End Sub

Private Sub Form_Activate()
nonaktif
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
End Sub

Private Sub Option1_Click()
Option2.Value = False
Option3.Value = False
Option4.Value = False
txtmakan1.Text = "Kentang Goreng"
txtmakan2.Text = "Nasi + Ayam Goreng"
txtminum.Text = "Pepsi Cola"
txtharga.Text = 20000
txtmakan1.Enabled = False
txtmakan2.Enabled = False
txtminum.Enabled = False
txtharga.Enabled = False
End Sub

Private Sub Option2_Click()
Option1.Value = False
Option3.Value = False
Option4.Value = False
txtmakan1.Text = "Burger Beaf"
txtmakan2.Text = "Nasi + Sup"
txtminum.Text = "Coca Cola"
txtharga.Text = 25000
txtmakan1.Enabled = False
txtmakan2.Enabled = False
txtminum.Enabled = False
txtharga.Enabled = False
End Sub

Private Sub Option3_Click()
Option1.Value = False
Option2.Value = False
Option4.Value = False
txtmakan1.Text = "Rollade Daging"
txtmakan2.Text = "Nasi + Sup + Ayam Goreng"
txtminum.Text = "Coke Float"
txtharga.Text = 30000
txtmakan1.Enabled = False
txtmakan2.Enabled = False
txtminum.Enabled = False
txtharga.Enabled = False
End Sub

Private Sub Option4_Click()
Option1.Value = False
Option2.Value = False
Option3.Value = False
txtmakan1.Text = "Kebab Chiken"
txtmakan2.Text = "Nasi + Sup + 2 Ayam Goreng"
txtminum.Text = "Bubble Float"
txtharga.Text = 45000
txtmakan1.Enabled = False
txtmakan2.Enabled = False
txtminum.Enabled = False
txtharga.Enabled = False
End Sub

Private Sub Option5_Click()
Option6.Value = False
txtdelivery.Text = 10000
txtjumbel.SetFocus
txtdelivery.Enabled = False
End Sub

Private Sub Option6_Click()
Option5.Value = False
txtditempat.Text = 0
txtjumbel.SetFocus
txtditempat.Enabled = False
End Sub

Private Sub txtjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtharga.Text) * Val(txtjumbel.Text)
If txtjumbel >= 10 Then
txtdiskon.Text = 10 / 100 * Val(txttotal.Text)
Else
txtdiskon.Text = 5 / 100 * Val(txttotal.Text)
txttobay.Text = Val(txttotal.Text) - Val(txtdiskon.Text)
End If
End If
txttotal.Enabled = False
txtdiskon.Enabled = False
txttobay.Enabled = False
txtbayar.Enabled = True
End Sub

Private Sub txtbayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali = Val(txtbayar.Text) - Val(txttobay.Text)
End If
End Sub

Senin, 31 Oktober 2011

Program Visual Jakarta Travel Agent

Posted by Unknown On Senin, Oktober 31, 2011 | No comments

Sintaknya :

Sub bersih()
txtnama.Text = " "
txtalamat.Text = " "
cmbkode.Text = "--Pilih Paket--"
txttema.Text = " "
List1.Text = 0
Option1.Value = False
Option2.Value = False
Option3.Value = False
txtharga.Text = " "
txtjumlah.Text = " "
txttotal.Text = " "
txtcash.Text = " "
txtstatus.Text = " "
End Sub

Sub nonaktif()
txtnama.Enabled = False
txtalamat.Enabled = False
cmbkode.Enabled = False
txttema.Enabled = False
List1.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
Option3.Enabled = False
txtharga.Enabled = False
txtjumlah.Enabled = False
txttotal.Enabled = False
txtcash.Enabled = False
txtstatus.Enabled = False
End Sub

Sub aktif()
txtnama.Enabled = True
txtalamat.Enabled = True
cmbkode.Enabled = True
txttema.Enabled = True
List1.Enabled = True
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
txtharga.Enabled = True
txtjumlah.Enabled = True
txttotal.Enabled = True
txtcash.Enabled = True
txtstatus.Enabled = True
txtnama.SetFocus
End Sub

Private Sub Timer1_Timer()
tanggal.Caption = Format(date, "dddd,d mmmm yyyy")
waktu.Caption = Format(time, "hh:mm:ss")
End Sub

Private Sub cmdproses_Click()
aktif
bersih
End Sub

Private Sub Form_Activate()
nonaktif
cmbkode.Text = "--Pilih Paket--"
cmbkode.AddItem "Paket 1"
cmbkode.AddItem "Paket 2"
cmbkode.AddItem "Paket 3"
List1.AddItem "Bandung"
List1.AddItem "Semarang"
List1.AddItem "Surabaya"
End Sub

Private Sub cmbkode_Click()
If cmbkode.Text = "Paket 1" Then
txttema.Text = "Family Holiday"
ElseIf cmbkode.Text = "Paket 2" Then
txttema.Text = "Etnic Holiday"
Else
txttema.Text = "Mount Holiday"
End If
End Sub

Private Sub Option1_Click()
If cmbkode.Text = "Paket 1" Then
If List1.Text = "Bandung" Then
txtharga.Text = 750000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 750000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 850000
End If
ElseIf cmbkode.Text = "Paket 2" Then
If List1.Text = "Bandung" Then
txtharga.Text = 900000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 350000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 500000
End If
ElseIf cmbkode.Text = "Paket 3" Then
If List1.Text = "Bandung" Then
txtharga.Text = 1000000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 850000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 550000
End If
End If
End Sub

Private Sub Option2_Click()
If cmbkode.Text = "Paket 1" Then
If List1.Text = "Bandung" Then
txtharga.Text = 550000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 650000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 750000
End If
ElseIf cmbkode.Text = "Paket 2" Then
If List1.Text = "Bandung" Then
txtharga.Text = 800000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 250000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 400000
End If
ElseIf cmbkode.Text = "Paket 3" Then
If List1.Text = "Bandung" Then
txtharga.Text = 900000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 750000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 450000
End If
End If
End Sub

Private Sub Option3_Click()
If cmbkode.Text = "Paket 1" Then
If List1.Text = "Bandung" Then
txtharga.Text = 600000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 600000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 700000
End If
ElseIf cmbkode.Text = "Paket 2" Then
If List1.Text = "Bandung" Then
txtharga.Text = 650000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 200000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 350000
End If
ElseIf cmbkode.Text = "Paket 3" Then
If List1.Text = "Bandung" Then
txtharga.Text = 850000
ElseIf List1.Text = "Semarang" Then
txtharga.Text = 700000
ElseIf List1.Text = "Surabaya" Then
txtharga.Text = 400000
End If
End If
End Sub

Private Sub txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
txtcash.SetFocus
End If
txttotal.Enabled = False
End Sub

Private Sub txtcash_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtcash = Val(txttotal.Text) Then
txtstatus.Text = "LUNAS"
ElseIf txtcash > Val(txttotal.Text) Then
txtstatus.Text = "Kembali " & "Rp. " & Val(txtcash.Text) - Val(txttotal.Text)
ElseIf txtcash <= Val(txttotal.Text) Then
txtstatus.Text = "Kurang " & "Rp. " & Val(txttotal.Text) - Val(txtcash.Text)
End If
cmdproses.SetFocus
nonaktif
End If
End Sub

Private Sub cmdexit_Click()
X = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "INFORMASI")
If X = vbYes Then
End
End If
End Sub

Kamis, 27 Oktober 2011

Program Visual Basic Cinema 21

Posted by Unknown On Kamis, Oktober 27, 2011 | 3 comments

Sintaknya :

Dim harga, total As Currency
Dim jumlah As Integer

Sub bersih()
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
End Sub

Private Sub Form_Activate()
bersih
cmbjam = "--Pilih--"
Option1.SetFocus
End Sub

Private Sub Option1_Click()
Option1.Value = True
txtjudul.Text = "Iron Man 2"
cmbjam.List(0) = "14:05"
cmbjam.List(1) = "15:55"
cmbjam.List(2) = "17:45"
cmbjam.List(3) = "19:35"
List1.List(0) = "Senin"
List1.List(1) = "Selasa"
List1.List(2) = "Rabu"
List1.List(3) = "Kamis"
List1.List(4) = "Jum'at"
List1.List(5) = "Sabtu"
List1.List(6) = "Minggu"
List2.List(0) = "A"
List2.List(1) = "B"
List2.List(2) = "C"
List2.List(3) = "D"
List2.List(4) = "E"
List2.List(5) = "F"
List2.List(6) = "G"
List2.List(7) = "H"
List2.List(8) = "I"
List2.List(9) = "J"
For s = 1 To 10
List3.AddItem s
Next
End Sub

Private Sub Option2_Click()
Option2.Value = True
txtjudul.Text = "The Book Of Eli"
cmbjam.List(0) = "14:45"
cmbjam.List(1) = "17:00"
cmbjam.List(2) = "19:15"
cmbjam.List(3) = "21:30"
List1.List(0) = "Senin"
List1.List(1) = "Selasa"
List1.List(2) = "Rabu"
List1.List(3) = "Kamis"
List1.List(4) = "Jum'at"
List1.List(5) = "Sabtu"
List1.List(6) = "Minggu"
List2.List(0) = "A"
List2.List(1) = "B"
List2.List(2) = "C"
List2.List(3) = "D"
List2.List(4) = "E"
List2.List(5) = "F"
List2.List(6) = "G"
List2.List(7) = "H"
List2.List(8) = "I"
List2.List(9) = "J"
For s = 1 To 10
List3.AddItem s
Next
End Sub

Private Sub Option3_Click()
Option3.Value = True
txtjudul.Text = "Green Zone"
cmbjam.List(0) = "14:55"
cmbjam.List(1) = "17:05"
cmbjam.List(2) = "19:15"
cmbjam.List(3) = "21:25"
List1.List(0) = "Senin"
List1.List(1) = "Selasa"
List1.List(2) = "Rabu"
List1.List(3) = "Kamis"
List1.List(4) = "Jum'at"
List1.List(5) = "Sabtu"
List1.List(6) = "Minggu"
List2.List(0) = "A"
List2.List(1) = "B"
List2.List(2) = "C"
List2.List(3) = "D"
List2.List(4) = "E"
List2.List(5) = "F"
List2.List(6) = "G"
List2.List(7) = "H"
List2.List(8) = "I"
List2.List(9) = "J"
For s = 1 To 10
List3.AddItem s
Next
End Sub

Private Sub Option4_Click()
Option4.Value = True
txtjudul.Text = "Hurt Locker"
cmbjam.List(0) = "14:25"
cmbjam.List(1) = "16:50"
cmbjam.List(2) = "19:15"
cmbjam.List(3) = "21:40"
List1.List(0) = "Senin"
List1.List(1) = "Selasa"
List1.List(2) = "Rabu"
List1.List(3) = "Kamis"
List1.List(4) = "Jum'at"
List1.List(5) = "Sabtu"
List1.List(6) = "Minggu"
List2.List(0) = "A"
List2.List(1) = "B"
List2.List(2) = "C"
List2.List(3) = "D"
List2.List(4) = "E"
List2.List(5) = "F"
List2.List(6) = "G"
List2.List(7) = "H"
List2.List(8) = "I"
List2.List(9) = "J"
For s = 1 To 10
List3.AddItem s
Next
End Sub

Private Sub cmdbeli_Click()
time.Caption = cmbjam
date.Caption = List1
judulfilm.Caption = txtjudul

jumlah = List3
Select Case List1.ListIndex
Case 0, 1, 2, 3
harga = 20000
total = jumlah * harga
txttotal.Text = total
price.Caption = total
Case 4
harga = 30000
total = jumlah * harga
txttotal.Text = total
price.Caption = total
Case 5, 6
harga = 45000
total = jumlah * harga
txttotal.Text = total
price.Caption = total
End Select
txtcash.SetFocus
End Sub

Private Sub txtcash_KeyPress(keyascii As Integer)
If keyascii = 13 Then
txtkembali = Val(txtcash) - Val(txttotal)
End If
End Sub

Private Sub cmdclear_Click()
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
txtjudul.Text = " "
cmbjam.Clear
List1.Clear
List2.Clear
List3.Clear
judulfilm.Caption = " "
time.Caption = " "
date.Caption = " "
txttotal.Text = " "
txtcash.Text = " "
txtkembali.Text = " "
End Sub

Private Sub cmdexit_Click()
X = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Confrimasi")
If X = vbYes Then
End
End If
End Sub

Program Visual Basic Pemesanan Tiket Pesawat

Posted by Unknown On Kamis, Oktober 27, 2011 | 2 comments

Sintaknya :

Dim i, jumlah As Variant

Private Sub Timer1_Timer()
tanggal = Format(Date, "dddd,d mmmm yyyy")
waktu = Format(Time, "hh:mm:ss")
End Sub

Private Sub Form_Activate()
cmbdari.Text = "--Pilih--"
cmbke.Text = "--Pilih--"
cmbhari.Text = "--Tanggal--"
cmbbulan.Text = "--Bulan--"
cmbtahun.Text = "--Tahun--"
cmbhari1.Text = "--Tanggal--"
cmbbulan1.Text = "--Bulan--"
cmbtahun1.Text = "--Tahun--"
For i = 1 To 31
Me.cmbhari.AddItem (Str(i))
Next i
For i = 1 To 12
Me.cmbbulan.AddItem (MonthName(i))
Next i
For i = 2010 To 2020
Me.cmbtahun.AddItem (Str(i))
Next i
For i = 1 To 31
Me.cmbhari1.AddItem (Str(i))
Next i
For i = 1 To 12
Me.cmbbulan1.AddItem (MonthName(i))
Next i
For i = 2010 To 2020
Me.cmbtahun1.AddItem (Str(i))
Next i
cmbdari.AddItem "Jakarta (CGK)"
cmbdari.AddItem "Denpasar (DPS)"
cmbdari.AddItem "Surabaya (SBY)"
cmbke.AddItem "Jakarta (CGK)"
cmbke.AddItem "Denpasar (DPS)"
cmbke.AddItem "Surabaya (SBY)"
txtnama.SetFocus
End Sub

Private Sub cmbtahunk_Click()
If cmbhari1.Text < cmbhari.Text Or cmbtahun1.Text < cmbtahun.Text Then
MsgBox "Tanggal Kembali Tidak Boleh Melebihi Tanggal Berangkat", vbInformation, "WARNING!"
End If
End Sub

Private Sub Option1_Click()
If cmbdari.ListIndex = 0 And cmbke.ListIndex = 1 Then
txtharga.Text = 1855000
ElseIf cmbdari.ListIndex = 0 And cmbke.ListIndex = 2 Then
txtharga.Text = 1200000
ElseIf cmbdari.ListIndex = 1 And cmbke.ListIndex = 0 Then
txtharga.Text = 1700000
ElseIf cmbdari.ListIndex = 2 And cmbke.ListIndex = 0 Then
txtharga.Text = 1055000
Else
MsgBox "Kota Asal Dan Kota Tujuan Tidak Boleh Sama", vbInformation, "WARNING!"
End If
End Sub

Private Sub Option2_Click()
If cmbdari.ListIndex = 0 And cmbke.ListIndex = 1 Then
txtharga.Text = 1050000
ElseIf cmbdari.ListIndex = 0 And cmbke.ListIndex = 2 Then
txtharga.Text = 750000
ElseIf cmbdari.ListIndex = 1 And cmbke.ListIndex = 0 Then
txtharga.Text = 900000
ElseIf cmbdari.ListIndex = 2 And cmbke.ListIndex = 0 Then
txtharga.Text = 600000
Else
MsgBox "Kota Asal Dan Kota Tujuan Tidak Boleh Sama", vbInformation, "WARNING!"
End If
End Sub

Dim harga, dewasa, bayi, hargabayi, subtotal, total As Currency

Private Sub Check1_Click()
dewasa = txtdewasa.Text
bayi = txtbayi.Text
harga = txtharga.Text
hargabayi = 0.15 * harga
bagasi = 30000
subtotal = (dewasa * harga) + (hargabayi * bayi)
total = subtotal + bagasi
txttotal.Text = subtotal
txttobay.Text = total
txtcash.SetFocus
End Sub

Private Sub Check2_Click()
dewasa = txtdewasa.Text
bayi = txtbayi.Text
harga = txtharga.Text
hargabayi = 0.15 * harga
bagasi = 60000
subtotal = (dewasa * harga) + (hargabayi * bayi)
total = subtotal + bagasi
txttotal.Text = subtotal
txttobay.Text = total
txtcash.SetFocus
End Sub

Private Sub Check3_Click()
dewasa = txtdewasa.Text
bayi = txtbayi.Text
harga = txtharga.Text
hargabayi = 0.15 * harga
bagasi = 90000
subtotal = (dewasa * harga) + (hargabayi * bayi)
total = subtotal + bagasi
txttotal.Text = subtotal
txttobay.Text = total
txtcash.SetFocus
End Sub

Private Sub txtcash_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali.Text = Val(txtcash.Text) - Val(txttobay.Text)
End If
End Sub

Private Sub cmdclear_Click()
cmbdari.Text = "--Pilih--"
cmbke.Text = "--Pilih--"
cmbhari.Text = "--Tanggal--"
cmbbulan.Text = "--Bulan--"
cmbtahun.Text = "--Tahun--"
cmbhari1.Text = "--Tanggal--"
cmbbulan1.Text = "--Bulan--"
cmbtahun1.Text = "--Tahun--"
txtnama.Text = " "
txttelepon.Text = " "
Option1.Value = False
Option2.Value = False
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
txtharga.Text = " "
txtdewasa.Text = " "
txtbayi.Text = " "
txttotal.Text = " "
txttobay.Text = " "
txtcash.Text = " "
txtkembali.Text = " "
txtnama.SetFocus
End Sub

Private Sub cmdexit_Click()
X = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Konfirmasi")
If X = vbYes Then
End
End If
End Sub

Senin, 24 Oktober 2011

Program Visual Basic Gaji Karyawan

Posted by Unknown On Senin, Oktober 24, 2011 | No comments


Sintaknya :

Private Sub Timer1_Timer()
tanggal = Format(Date, "dddd,d mmmm yyyy")
waktu = Format(Time, "hh:mm:ss")
Label1.Left = Label1.Left - 30
If Label1.Left < -5000 Then
Label1.Left = 11000
End If
End Sub

Private Sub Form_Activate()
cmbnip = "--NIP--"
cmbnip.AddItem "110011"
cmbnip.AddItem "120012"
cmbnip.AddItem "130013"
cmbnip.AddItem "140014"
txttoga.Enabled = False
txtnama.Enabled = False
txtgaji.Enabled = False
txtistri.Enabled = False
txtanak.Enabled = False
cmbnip.SetFocus
End Sub

Private Sub cmbnip_Click()
If cmbnip.Text = "110011" Then
txtnama.Text = "Rahima"
ElseIf cmbnip.Text = "120012" Then
txtnama.Text = "Zakia"
ElseIf cmbnip.Text = "130013" Then
txtnama.Text = "Intan"
Else
txtnama.Text = "Henry"
End If
End Sub

Private Sub Option1_Click()
txtgaji.Text = 5000000
End Sub

Private Sub Option2_Click()
txtgaji.Text = 3000000
End Sub

Private Sub Option3_Click()
txtgaji.Text = 2000000
End Sub

Private Sub Option4_Click()
txtgaji.Text = 1000000
End Sub

Private Sub Check1_Click()
If Option1.Value = True Then
ElseIf Check1.Value = 1 Then
txtistri.Text = 0.15 * Val(txtgaji.Text)
Else
txtistri.Text = 0
End If
If Option2.Value = True Then
ElseIf Check1.Value = 1 Then
txtistri.Text = 0.15 * Val(txtgaji.Text)
Else
txtistri.Text = 0
End If
If Option3.Value = True Then
ElseIf Check1.Value = 1 Then
txtistri.Text = 0.15 * Val(txtgaji.Text)
Else
txtistri.Text = 0
End If
If Option4.Value = True Then
ElseIf Check1.Value = 1 Then
txtistri.Text = 0.15 * Val(txtgaji.Text)
Else
txtistri.Text = 0
End If
End Sub

Private Sub Check2_Click()
If Option1.Value = True Then
ElseIf Check2.Value = 1 Then
txtanak.Text = 0.1 * Val(txtgaji.Text)
Else
txtanak.Text = 0
End If
If Option2.Value = True Then
ElseIf Check2.Value = 1 Then
txtanak.Text = 0.1 * Val(txtgaji.Text)
Else
txtanak.Text = 0
End If
If Option3.Value = True Then
ElseIf Check2.Value = 1 Then
txtanak.Text = 0.1 * Val(txtgaji.Text)
Else
txtanak.Text = 0
End If
If Option4.Value = True Then
ElseIf Check2.Value = 1 Then
txtanak.Text = 0.1 * Val(txtgaji.Text)
Else
txtanak.Text = 0
End If
End Sub

Private Sub cmdhitung_Click()
txttoga.Text = Val(txtgaji.Text) + Val(txtistri.Text) + Val(txtanak.Text)
cmdlagi.SetFocus
End Sub

Private Sub cmdlagi_Click()
cmbnip = "--NIP--"
txtnama.Text = " "
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Check1.Value = False
Check2.Value = False
txtgaji.Text = " "
txtistri.Text = " "
txtanak.Text = " "
txttoga.Text = " "
cmbnip.SetFocus
End Sub

Private Sub cmdexit_Click()
x = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Konfirmasi")
If x = vbYes Then
End
End If
End Sub

Minggu, 23 Oktober 2011

Program Visual Basic Buana Travel

Posted by Unknown On Minggu, Oktober 23, 2011 | No comments

Sintaknya :

Sub nonaktif()
txtnopes.Enabled = False
cmbkopet.Enabled = False
txtnapet.Enabled = False
List1.Enabled = False
txttujuan.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
Option3.Enabled = False
txtharga.Enabled = False
txtppn.Enabled = False
txtjumbay.Enabled = False
txtubay.Enabled = False
txtukem.Enabled = False
End Sub

Sub aktif()
txtnopes.Enabled = True
cmbkopet.Enabled = True
txtnapet.Enabled = True
List1.Enabled = True
txttujuan.Enabled = True
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
txtharga.Enabled = True
txtppn.Enabled = True
txtjumbay.Enabled = True
txtubay.Enabled = True
txtukem.Enabled = True
End Sub

Private Sub Form_Activate()
nonaktif
cmbkopet.Text = "--Kode Petugas--"
txttanggal.Text = Now
cmbkopet.AddItem "PTG001"
cmbkopet.AddItem "PTG002"
cmbkopet.AddItem "PTG003"
List1.AddItem "JW001"
List1.AddItem "BL002"
List1.AddItem "BN001"
cmdbersih.SetFocus
End Sub

Private Sub txtnopes_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
aktif
End If
txtnopes.SetFocus
End Sub

Private Sub Timer1_Timer()
tanggal.Caption = Format(Date, "dddd,d mmmm yyyy")
waktu.Caption = Format(Time, "hh:mm:ss")
End Sub

Private Sub cmbkopet_Click()
If cmbkopet.Text = "PTG001" Then
txtnapet.Text = "ANDIKA"
ElseIf cmbkopet.Text = "PTG002" Then
txtnapet.Text = "BIMA"
Else
txtnapet.Text = "DENI"
End If
End Sub

Private Sub List1_Click()
If List1.Text = "JW001" Then
txttujuan = "Jakarta - Yogjakarta"
ElseIf List1.Text = "BL002" Then
txttujuan = "Jakarta - Bali"
Else
txttujuan = "Jakarta - Bunaken"
End If
End Sub

Private Sub Option1_Click()
If txttujuan.Text = "Jakarta - Yogjakarta" Then
txtharga.Text = 5000000
ElseIf txttujuan.Text = "Jakarta - Bali" Then
txtharga.Text = 4500000
Else
txtharga.Text = 7500000
End If
cmdhitung.SetFocus
End Sub

Private Sub Option2_Click()
If txttujuan.Text = "Jakarta - Yogjakarta" Then
txtharga.Text = 2500000
ElseIf txttujuan.Text = "Jakarta - Bali" Then
txtharga.Text = 3000000
Else
txtharga.Text = 5000000
End If
cmdhitung.SetFocus
End Sub

Private Sub Option3_Click()
If txttujuan.Text = "Jakarta - Yogjakarta" Then
txtharga.Text = 7000000
ElseIf txttujuan.Text = "Jakarta - Bali" Then
txtharga.Text = 8000000
Else
txtharga.Text = 10000000
End If
cmdhitung.SetFocus
End Sub

Private Sub cmdhitung_Click()
txtppn.Text = 0.1 * Val(txtharga.Text)
txtjumbay.Text = Val(txtharga.Text) - Val(txtppn.Text)
txtubay.SetFocus
End Sub

Private Sub txtubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtukem.Text = Val(txtubay.Text) - Val(txtjumbay.Text)
nonaktif
End If
End Sub

Private Sub cmdbersih_Click()
aktif
cmbkopet.Text = "--Kode Petugas--"
txttanggal.Text = Now()
txtnopes.Text = " "
txtnapet.Text = " "
List1.ListIndex = -1
txttujuan.Text = " "
Option1.Value = False
Option2.Value = False
Option3.Value = False
txtharga.Text = " "
txtppn.Text = " "
txtjumbay.Text = " "
txtubay.Text = " "
txtukem.Text = " "
txtnopes.SetFocus
End Sub

Private Sub cmdkeluar_Click()
X = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Konfrimasi")
If X = vbYes Then
End
End If
End Sub

Program Visual Basic Penjualan Tiket Pesawat Terbang

Posted by Unknown On Minggu, Oktober 23, 2011 | No comments

Sintaknya :


Sub nonaktif()
txtnama.Enabled = False
txttelp.Enabled = False
cmbkode.Enabled = False
List1.Enabled = False
txtmaskapai.Enabled = False
txttujuan.Enabled = False
txtjam.Enabled = False
txtbonus.Enabled = False
txtharga.Enabled = False
txtjumbel.Enabled = False
txttotal.Enabled = False
txtcash.Enabled = False
txtkembali.Enabled = False
End Sub

Sub aktif()
txtnama.Enabled = True
txttelp.Enabled = True
cmbkode.Enabled = True
List1.Enabled = True
txtmaskapai.Enabled = True
txttujuan.Enabled = True
txtjam.Enabled = True
txtbonus.Enabled = True
txtharga.Enabled = True
txtjumbel.Enabled = True
txttotal.Enabled = True
txtcash.Enabled = True
txtkembali.Enabled = True
End Sub

Private Sub Timer1_Timer()
waktu = Format(Time, "hh:mm:ss")
tanggal = Format(Date, "dddd,d mmmm yyyy")
Label1.Left = Label1.Left - 30
If Label1.Left < -6000 Then
Label1.Left = 12000
If Label1.ForeColor = vbRed Then
Label1.ForeColor = vbGreen
Label1.ForeColor = vbBlack
Label1.ForeColor = vbBlue
Else
Label1.ForeColor = vbRed
End If
End If
End Sub

Private Sub KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
aktif
End Sub

Private Sub Form_Activate()
nonaktif
cmbkode = "--Pilih Kode--"
cmbkode.AddItem "GDI"
cmbkode.AddItem "AKI"
cmbkode.AddItem "SJA"
cmbkode.AddItem "BTV"
List1.AddItem "Pagi"
List1.AddItem "Siang"
List1.AddItem "Sore"
List1.AddItem "Malam"
cmdlagi.SetFocus
End Sub

Private Sub cmbkode_Click()
If cmbkode.Text = "GDI" Then
txtmaskapai.Text = "Garuda Indonesia"
txttujuan.Text = "Jakarta - Bali"
txtharga.Text = 1200000
ElseIf cmbkode.Text = "AKI" Then
txtmaskapai.Text = "Air Asia"
txttujuan.Text = "Jakarta - Singapore"
txtharga.Text = 2500000
ElseIf cmbkode.Text = "SJA" Then
txtmaskapai.Text = "Sriwijaya Air"
txttujuan.Text = "Jakarta - Jogjakarta"
txtharga.Text = 650000
ElseIf cmbkode.Text = "BTV" Then
txtmaskapai.Text = "Batavia Air"
txttujuan.Text = "Jakarta - Makassar"
txtharga.Text = 800000
End If
txtmaskapai.Enabled = False
txttujuan.Enabled = False
txtharga.Enabled = False
List1.SetFocus
End Sub

Private Sub List1_Click()
If cmbkode.Text = "GDI" Then
ElseIf List1.Text = "Pagi" Then
txtjam.Text = "06.00 WIB"
txtbonus.Text = "Aneka Pilihan Sarapan Pagi Nusantara"
ElseIf List1.Text = "Siang" Then
txtjam.Text = "11.00 WIB"
txtbonus.Text = "Makan Siang + Snack"
ElseIf List1.Text = "Sore" Then
txtjam.Text = "17.45 WIB"
txtbonus.Text = "Snack + Soft Drink"
ElseIf List1.Text = "Malam" Then
txtjam.Text = "20.00"
txtbonus.Text = "Pilihan Makan Malam"
End If
If cmbkode.Text = "AKI" Then
ElseIf List1.Text = "Pagi" Then
txtjam.Text = "07.15 WIB"
txtbonus.Text = "Sarapan Pagi"
ElseIf List1.Text = "Siang" Then
txtjam.Text = "11.45 WIB"
txtbonus.Text = "Makan Siang"
ElseIf List1.Text = "Sore" Then
txtjam.Text = "16.45 WIB"
txtbonus.Text = "Snack + Teh Hangat"
ElseIf List1.Text = "Malam" Then
txtjam.Text = "19.00 WIB"
txtbonus.Text = "Makan Malam"
End If
If cmbkode.Text = "SJA" Then
ElseIf List1.Text = "Pagi" Then
txtjam.Text = "05.15 WIB"
txtbonus.Text = "Sarapan Pagi"
ElseIf List1.Text = "Siang" Then
txtjam.Text = "12.45 WIB"
txtbonus.Text = "Snack + Soft Drink"
ElseIf List1.Text = "Sore" Then
txtjam.Text = "18.45 WIB"
txtbonus.Text = "Snack + Teh Hangat"
ElseIf List1.Text = "Malam" Then
txtjam.Text = "21.00 WIB"
txtbonus.Text = "Makan Malam"
End If
If cmbkode.Text = "BTV" Then
ElseIf List1.Text = "Pagi" Then
txtjam.Text = "06.30 WIB"
txtbonus.Text = "Sarapan Pagi"
ElseIf List1.Text = "Siang" Then
txtjam.Text = "12.15 WIB"
txtbonus.Text = "Snack"
ElseIf List1.Text = "Sore" Then
txtjam.Text = "16.00 WIB"
txtbonus.Text = "Snack + Teh Hangat"
ElseIf List1.Text = "Malam" Then
txtjam.Text = "20.30 WIB"
txtbonus.Text = "Makan Malam + Snack"
End If
txtjam.Enabled = False
txtbonus.Enabled = False
txtjumbel.SetFocus
End Sub

Private Sub txtjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtharga.Text) * Val(txtjumbel.Text)
End If
txttotal.Enabled = False
End Sub

Private Sub txtcash_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali = Val(txtcash.Text) - Val(txttotal.Text)
nonaktif
End If
End Sub

Private Sub cmdlagi_Click()
aktif
cmbkode = "--Pilih Kode--"
txtnama.Text = " "
txttelp.Text = " "
List1.ListIndex = -1
txtmaskapai.Text = " "
txttujuan.Text = " "
txtjam.Text = " "
txtbonus.Text = " "
txtharga.Text = " "
txtjumbel.Text = " "
txttotal.Text = " "
txtcash.Text = " "
txtkembali.Text = " "
txtnama.SetFocus
End Sub

Private Sub cmdexit_Click()
X = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Konfirmasi")
If X = vbYes Then
End
End If
End Sub

Jumat, 14 Oktober 2011

Program Visual Basic VCD/CD Cartoon

Posted by Unknown On Jumat, Oktober 14, 2011 | No comments

Sintaknya :

Private Sub Timer1_Timer()
txtwaktu = Time
txttanggal = Format(Date, "dddd,d mmmm yyyy")
End Sub
Private Sub Form_Activate()
cmbkode.Text = "--Kode--"
cmbkode.SetFocus
End Sub

Private Sub Form_Load()
cmbkode.AddItem ("001")
cmbkode.AddItem ("002")
cmbkode.AddItem ("003")
cmbkode.AddItem ("004")
cmbkode.AddItem ("005")
End Sub

Private Sub cmbkode_Click()
If cmbkode = "001" Then
txtnama = "Detective Conan Series"
txtharga = 45000
ElseIf cmbkode = "002" Then
txtnama = "Dragon Ball Series"
txtharga = 26000
ElseIf cmbkode = "003" Then
txtnama = "Naruto Shippuden Series"
txtharga = 40000
ElseIf cmbkode = "004" Then
txtnama = "Deathe Note Series"
txtharga = 25000
ElseIf cmbkode = "005" Then
txtnama = "Bleach Series"
txtharga = 32000
End If
End Sub

Private Sub Check1_Click()
If Check1 = 1 And Check2 = 0 Then
txtharga1 = 5000
ElseIf Check1 = 0 And Check2 = 1 Then
txtharga1 = 10000
ElseIf Check1 = 1 And Check2 = 1 Then
txtharga1 = 15000
Else
txtharga1 = 0
txtharga1.SetFocus
End If
End Sub

Private Sub Check2_Click()
If Check1 = 1 And Check2 = 0 Then
txtharga1 = 5000
ElseIf Check1 = 0 And Check2 = 1 Then
txtharga1 = 10000
ElseIf Check1 = 1 And Check2 = 1 Then
txtharga1 = 15000
Else
txtharga1 = 0
End If
End Sub

Private Sub txtharga1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttobay = (Val(txtharga.Text) * Val(txtjumbel.Text)) + Val(txtharga1.Text)
End If
txtbayar.SetFocus
End Sub

Private Sub txtbayar_Change()
txtkembali = Val(txtbayar.Text) - Val(txttobay.Text)
End Sub

Private Sub cmdclear_Click()
cmbkode.Text = "--Kode--"
txtnama.Text = " "
txtharga.Text = " "
txtjumbel.Text = " "
Check1.Value = False
Check2.Value = False
txtharga1.Text = " "
txttobay.Text = " "
txtbayar.Text = " "
txtkembali.Text = " "
cmdexit.SetFocus
End Sub

Private Sub cmdexit_Click()
x = MsgBox("Are Your Sure Exit?", vbQuestion + vbYesNoCancel, "Confrimasi")
If x = vbYes Then
End
End If
End Sub

Rabu, 12 Oktober 2011

Program Visual Basic Penjualan Tiket

Posted by Unknown On Rabu, Oktober 12, 2011 | No comments

Sintaknya :

Private Sub Timer1_Timer()
txtjam = Time
txttanggal = Format(Date, "dddd,d mmmm yyyy")
If Label1.Enabled = True Then
Label1.Enabled = False
Else
Label1.Enabled = True
End If
End Sub

Private Sub Form_Activate()
cmbkode.SetFocus
End Sub

Private Sub Form_Load()
cmbkode = "--Kode Tiket--"
cmbkode.AddItem "SEN02A"
cmbkode.AddItem "MUT01C"
cmbkode.AddItem "BIM03B"
List1.AddItem "Bandung"
List1.AddItem "Semarang"
List1.AddItem "Surabaya"
End Sub

Private Sub cmbkode_Click()
If Left(cmbkode.Text, 3) = "SEN" Then
txtnama = "Senja Utama"
ElseIf Left(cmbkode.Text, 4) = "MUT" Then
txtnama = "Mutiara Timur"
Else
txtnama = "Bima Kencana"
End If
If Mid(cmbkode.Text, 4, 2) = "01" Then
txthari.Text = "Senin"
ElseIf Mid(cmbkode.Text, 4, 2) = "02" Then
txthari.Text = "Selasa"
Else
txthari.Text = "Rabu"
End If
If Right(cmbkode.Text, 1) = "A" Then
txtwaktu.Text = "09.00"
ElseIf Right(cmbkode.Text, 1) = "B" Then
txtwaktu.Text = "13.00"
Else
txtwaktu.Text = "19.00"
End If
End Sub

Private Sub cmdhitung_Click()
txttobay = txtharga * Val(txtjumbel)
txtubay.SetFocus
End Sub

Private Sub Option1_Click()
If List1 = "Bandung" Then
txtharga = 300000
ElseIf List1 = "Semarang" Then
txtharga = 350000
Else
txtharga = 400000
End If
End Sub

Private Sub Option2_Click()
If List1 = "Bandung" Then
txtharga = 100000
ElseIf List1 = "Semarang" Then
txtharga = 150000
Else
txtharga = 200000
End If
End Sub

Private Sub Option3_Click()
If List1 = "Bandung" Then
txtharga = 200000
ElseIf List1 = "Semarang" Then
txtharga = 250000
Else
txtharga = 300000
End If
End Sub

Private Sub txtjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub

Private Sub txtubay_Change()
txtukem = Val(txtubay) - Val(txttobay)
End Sub

Private Sub cmdbersih_Click()
cmbkode = "--Kode Tiket--"
txtnama = " "
List1.Text = " "
Option1.Value = False
Option2.Value = False
Option3.Value = False
txtharga.Text = " "
txtjumbel.Text = " "
txthari = " "
txtwaktu = " "
txttobay = " "
txtubay = " "
txtukem = " "
End Sub

Private Sub cmdexit_Click()
X = MsgBox("Do U Wanna Quit...?", vbQuestion + vbOKCancel, "Konfirmasi")
If X = vbOK Then
Unload Me
End If
End Sub

Selasa, 11 Oktober 2011

Program Visual Basic Hotel

Posted by Unknown On Selasa, Oktober 11, 2011 | No comments

Sintaknya :

Private Sub Timer1_Timer()
waktu.Caption = Format(Time, "hh : mm : ss")
tanggal.Caption = Format(Date, "dddd / mmmm / yyyy")
If Label1.Enabled = True Then
Label1.Enabled = False
Else
Label1.Enabled = True
End If
End Sub

Private Sub cmdkeluar_Click()
x = MsgBox("Are You Sure To Quit?", vbQuestion + vbOKCancel, "Konfirmasi")
If x = vbOK Then
End
End If
End Sub

Sub nonaktif()
txtnama.Enabled = False
cmbkode.Enabled = False
txtjenis.Enabled = False
txtharga.Enabled = False
txtlama.Enabled = False
txtbayar.Enabled = False
txtdiskon.Enabled = False
txttobay.Enabled = False
txtubay.Enabled = False
txtukem.Enabled = False
End Sub

Sub aktif()
txtnama.Enabled = True
cmbkode.Enabled = True
txtjenis.Enabled = True
txtharga.Enabled = True
txtlama.Enabled = True
txtbayar.Enabled = True
txtdiskon.Enabled = True
txttobay.Enabled = True
txtubay.Enabled = True
txtukem.Enabled = True
End Sub

Sub bersih()
txtnama.Text = " "
cmbkode.Text = " "
txtjenis.Text = " "
txtharga.Text = " "
txtlama.Text = " "
txtbayar.Text = " "
txtdiskon.Text = " "
txttobay.Text = " "
txtubay.Text = " "
txtukem.Text = " "
End Sub

Private Sub cmbkode_Click()
If cmbkode.Text = "001" Then
txtjenis.Text = "VIP"
txtharga.Text = 350000
ElseIf cmbkode.Text = "002" Then
txtjenis.Text = "Deluxe"
txtharga.Text = 250000
Else
txtjenis.Text = "Standart"
txtharga.Text = 150000
End If
txtlama.SetFocus
End Sub

Private Sub cmdbersih_Click()
aktif
bersih
txtnama.SetFocus
End Sub

Private Sub cmdhitung_Click()
txtbayar.Text = Val(txtharga) * Val(txtlama)
If txtbayar.Text >= 500000 Then
txtdiskon = Val(txtbayar) * 0.1
txttobay = Val(txtbayar) - Val(txtdiskon)
End If
txtubay.SetFocus
End Sub

Private Sub Form_Activate()
nonaktif
bersih
cmdbersih.SetFocus
End Sub

Private Sub Form_Load()
cmbkode.AddItem "001"
cmbkode.AddItem "002"
cmbkode.AddItem "003"
End Sub

Private Sub txtlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub

Private Sub txtubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtukem.Text = Val(txtubay) - Val(txttobay)
nonaktif
cmdbersih.SetFocus
End If
End Sub

Program Visual Basic Cafe Of Yunfa

Posted by Unknown On Selasa, Oktober 11, 2011 | No comments

Sintaknya :

Private Sub Form_Load()
cmbmenu.AddItem ("Sarapan Pagi")
cmbmenu.AddItem ("Makan Siang")
cmbmenu.AddItem ("Makan Malam")
cmbpaket.AddItem ("Paket 1")
cmbpaket.AddItem ("Paket 2")
End Sub

Private Sub txtjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttobay = Val(txtjumbel) * Val(Val(txthargamenu.Text) + Val(txthargafasilitas.Text) + Val(txthargaminuman))
txtubay.SetFocus
End If
End Sub

Private Sub cmbpaket_Click()
If cmbmenu.Text = "Sarapan Pagi" Then
Select Case (cmbpaket.Text)
Case "Paket 1"
List1.Clear
List1.AddItem ("Nasi Uduk")
List1.AddItem ("Telur")
List1.AddItem ("Tempe Orek")
txthargamenu = 5000
Case Else
List1.Clear
List1.AddItem ("Nasi Goreng")
List1.AddItem ("Telur Mata Sapi")
List1.AddItem ("Tempe Goreng")
txthargamenu = 7000
End Select
Else
If cmbmenu.Text = "Makan Siang" Then
Select Case (cmbpaket.Text)
Case "Paket 1"
List1.Clear
List1.AddItem ("Nasi Putih")
List1.AddItem ("Ayam Bakar")
List1.AddItem ("Lalapan")
txthargamenu = 8000
Case Else
List1.Clear
List1.AddItem ("Nasi Putih")
List1.AddItem ("Rendang")
List1.AddItem ("Sambal Ijo")
txthargamenu = 10000
End Select
Else
If cmbmenu.Text = "Makan Malam" Then
Select Case (cmbpaket.Text)
Case "Paket 1"
List1.Clear
List1.AddItem ("Nasi Putih")
List1.AddItem ("Soto Makassar")
List1.AddItem ("Kerupuk Udang")
List1.AddItem ("Sambal Ijo")
txthargamenu = 12000
Case Else
List1.Clear
List1.AddItem ("Nasi Putih")
List1.AddItem ("Ikan Bakar")
List1.AddItem ("Kerupuk Udang")
List1.AddItem ("Sambal Terasi")
txthargamenu = 15000
End Select
End If
End If
End If
End Sub

Private Sub Check1_Click()
If Check1 = 1 And Check2 = 1 Then
txthargaminuman = 3000
ElseIf Check1 = 1 And Check2 = 0 Then
txthargaminuman = 2500
ElseIf Check1 = 0 And Check2 = 1 Then
txthargaminuman = 500
Else
txthargaminuman = 0
End If
End Sub

Private Sub Check2_Click()
If Check1 = 1 And Check2 = 1 Then
txthargaminuman = 3000
ElseIf Check1 = 1 And Check2 = 0 Then
txthargaminuman = 2500
ElseIf Check1 = 0 And Check2 = 1 Then
txthargaminuman = 500
Else
txthargaminuman = 0
End If
End Sub

Private Sub txtubay_Change()
txtukem = Val(txtubay.Text) - Val(txttobay.Text)
End Sub

Private Sub Option1_Click()
txthargafasilitas = 5000
End Sub

Private Sub Option2_Click()
txthargafasilitas = 0
End Sub

Private Sub cmdclear_Click()
cmbmenu.Text = " "
cmbpaket.Text = " "
txthargamenu = " "
txthargafasilitas.Text = " "
txthargaminuman.Text = " "
txtjumbel.Text = " "
txttobay.Text = " "
txtubay.Text = " "
txtukem.Text = " "
cmbmenu.SetFocus
End Sub

Private Sub cmdexit_Click()
x = MsgBox("Anda Akan Keluar Dari Form Ini?", vbQuestion + vbOKCancel, "Informasi")
If x = vbOK Then
End
End If
End Sub

Program Visual Basic Perhitungan Nilai Mahasiswa

Posted by Unknown On Selasa, Oktober 11, 2011 | No comments

Sintaknya :

Private Sub Form_Activate()
habsen.Enabled = False
htugas.Enabled = False
huts.Enabled = False
huas.Enabled = False
txtabsen.SetFocus
End Sub

Private Sub txtabsen_Change()
habsen = 0.1 * Val(txtabsen.Text)
End Sub

Private Sub txttugas_Change()
htugas = 0.2 * Val(txttugas.Text)
End Sub

Private Sub txtuts_Change()
huts = 0.3 * Val(txtuts.Text)
End Sub

Private Sub txtuas_Change()
huas = 0.4 * Val(txtuas.Text)
End Sub

Private Sub cmdhitung_Click()
'Menghitung Total Nilai
txttotal = Val(habsen.Text) + Val(htugas.Text) + Val(huts.Text) + Val(huas.Text)
'Menghitung Grade
If txttotal >= 80 And txttotal <= 100 Then txtgrade = "A" Else If txttotal >= 69 And txttotal <= 79 Then txtgrade = "B" Else If txttotal >= 56 And txttotal <= 68 Then txtgrade = "C" Else If txttotal >= 40 And txttotal <= 55 Then
txtgrade = "D"
Else
txtgrade = "E"
End If
End If
End If
End If
'Menghitung Keterangan
If txtgrade = "A" Or txtgrade = "B" Or txtgrade = "C" Then
txtket = "LULUS"
Else
txtket = "GAGAL"
End If
End Sub

Private Sub cmdbersih_Click()
txtabsen.Text = " "
txttugas.Text = " "
txtuts.Text = " "
txtuas.Text = " "
habsen.Text = " "
htugas.Text = " "
huts.Text = " "
huas.Text = " "
txttotal.Text = " "
txtgrade.Text = " "
txtket.Text = " "
txtabsen.SetFocus
End Sub

Private Sub cmdkeluar_Click()
x = MsgBox("Anda Ingin Keluar Dari Form Ini?", vbQuestion + vbOKCancel, "Informasi")
If x = vbOK Then
End
End If
End Sub

Program Visual Basic String

Posted by Unknown On Selasa, Oktober 11, 2011 | No comments

Sintaknya :

Private Sub Timer1_Timer()
waktu = Time
tanggal = Format(Date, "dddd,d mmmm yyyy")
End Sub

Private Sub cmdkeluar_Click()
x = MsgBox("Anda Akan Keluar Dari Form Ini?", vbQuestion + vbOKCancel, "Informasi")
If x = vbOK Then
End
End If
End Sub

Private Sub cmdbersih_Click()
txtkata.Text = " "
txtleft.Text = " "
txtright.Text = " "
txtmid.Text = " "
txtlen.Text = " "
txtltrim.Text = " "
txtrtrim.Text = " "
txtlcase.Text = " "
txtucase.Text = " "
txtkata.SetFocus
End Sub

Private Sub txtkata_Change()
txtleft = Left(txtkata, 3)
txtright = Right(txtkata, 3)
txtmid = Mid(txtkata, 3, 3)
txtlen = Len(txtkata)
txtltrim = LTrim(txtkata)
txtrtrim = RTrim(txtkata)
txtlcase = LCase(txtkata)
txtucase = UCase(txtkata)
End Sub

Program Visual Basic Operator

Posted by Unknown On Selasa, Oktober 11, 2011 | No comments

Sintaknya :

Private Sub cmdbersih_Click()
txtnil1.Text = " "
txtnil2.Text = " "
txthasil.Text = " "
txtnil1.SetFocus
End Sub

Private Sub cmdkeluar_Click()
x = MsgBox("Anda Ingin Keluar Dari Form Ini?", vbQuestion + vbOKCancel, "Informasi")
If x = vbOK Then
End
End If
End Sub

Private Sub cmdtambah_Click()
txthasil = Val(txtnil1.Text) + Val(txtnil2.Text)
End Sub

Private Sub cmdkurang_Click()
txthasil = Val(txtnil1.Text) - Val(txtnil2.Text)
End Sub

Private Sub cmdbagi_Click()
txthasil = Val(txtnil1.Text) / Val(txtnil2.Text)
End Sub

Private Sub cmdkali_Click()
txthasil = Val(txtnil1.Text) * Val(txtnil2.Text)
End Sub

Private Sub cmdpangkat_Click()
txthasil = Val(txtnil1.Text) ^ Val(txtnil2.Text)
End Sub

Private Sub cmdmod_Click()
txthasil = Val(txtnil1.Text) Mod Val(txtnil2.Text)
End Sub

Private Sub cmd1_Click()
txthasil = Val(txtnil1.Text) > Val(txtnil2.Text)
End Sub

Private Sub cmd2_Click()
txthasil = Val(txtnil1.Text) < Val(txtnil2.Text) End Sub Private Sub cmd3_Click() txthasil = Val(txtnil1.Text) >= Val(txtnil2.Text)
End Sub

Private Sub cmd4_Click()
txthasil = Val(txtnil1.Text) <= Val(txtnil2.Text) End Sub Private Sub cmd5_Click() txthasil = Val(txtnil1.Text) = Val(txtnil2.Text) End Sub Private Sub cmd6_Click() txthasil = Val(txtnil1.Text) <> Val(txtnil2.Text)
End Sub

Senin, 10 Oktober 2011

Program Visual Basic Toko Kue & Roti

Posted by Unknown On Senin, Oktober 10, 2011 | No comments

Sintaknya :

Private Sub cmdclear_Click()
txtkode.Text = " "
txtjenis.Text = " "
txtharga.Text = " "
txtjumlah.Text = " "
txtpembayaran.Text = " "
txtpotongan.Text = " "
txtppn.Text = " "
txttobay.Text = " "
txtubay.Text = " "
txtukem.Text = " "
txtkode.SetFocus
End Sub

Private Sub Timer1_Timer()
txtwaktu.Text = Time
txttanggal.Text = Format(Date, "dddd,d mmmm yyyy")
End Sub

Private Sub cmdhitung_Click()
txtpembayaran = Val(txtharga.Text) * Val(txtjumlah.Text)
txtpotongan = 0.05 * Val(txtpembayaran.Text)
txtppn = 0.01 * Val(txtpembayaran.Text)
txttobay = (Val(txtpembayaran.Text) - Val(txtpotongan.Text)) + Val(txtppn)
txtubay.SetFocus
End Sub

Private Sub txtubay_Change()
txtukem = Val(txtubay.Text) - Val(txttobay)
End Sub

Private Sub cmdexit_Click()
x = MsgBox("Apa Anda Ingin Keluar Dari Form Ini?", vbQuestion + vbOKCancel, "Informasi")
If x = vbOK Then
End
End If
End Sub

Program Visual Basic PT Raya Travel

Posted by Unknown On Senin, Oktober 10, 2011 | No comments


Sintaknya :

Private Sub Timer1_Timer()
txtwaktu = time
txttanggal = Format(date, "dddd,d mmmm yyyy")
End Sub

Private Sub cmdclear_Click()
txtkode.Text = " "
txtjumlah.Text = " "
txtjenis.Text = " "
txtharga.Text = " "
txtpembayaran.Text = " "
txtpotongan.Text = " "
txtppn.Text = " "
txtbayar.Text = " "
txtkembali.Text = " "
txttobay.Text = " "
cmdexit.SetFocus
End Sub

Private Sub cmdexit_Click()
X = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Konfirmasi")
If X = vbYes Then
End
End If
End Sub

Private Sub cmdhitung_Click()
txtpembayaran = Val(txtharga.Text) * Val(txtjumlah.Text)
txtpotongan = 0.1 * Val(txtpembayaran.Text)
txtppn = 0.5 * Val(txtpembayaran.Text)
txttobay = (Val(txtpembayaran.Text) - Val(txtpotongan.Text) + Val(txtppn))
txtbayar.SetFocus
End Sub

Private Sub txtbayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali = Val(txtbayar) - Val(txttobay)
End If
End Sub

Program Visual Basic Perulangan

Posted by Unknown On Senin, Oktober 10, 2011 | No comments


Sintaknya :

Dim i, jumlah As Variant

Private Sub Form_Load()
For i = 1 To 31
Me.cmbtanggal.AddItem (Str(i))
Next i

For i = 1 To 12
Me.cmbbulan.AddItem (MonthName(i))
Next i

For i = 1970 To Year(Now)
Me.cmbtahun.AddItem (Str(i))
Next i
End Sub

Private Sub cmddountil_Click()
List1.Clear
i = 3
Do Until i > 8
List1.AddItem (i)
i = i + 2
Loop
End Sub

Private Sub cmddowhile_Click()
List1.Clear
i = 20
Do While i > 10
List1.AddItem (i)
i = i - 5
Loop
End Sub

Private Sub cmdfornext_Click()
List1.Clear
Dim a As Integer
a = 2
jumlah = 0
For i = 1 To 10
List1.AddItem (i)
jumlah = jumlah + a
a = a + 3
Next
End Sub

Private Sub cmdwhilewent_Click()
List1.Clear
i = 10
While i <= 60
List1.AddItem (i)
i = i + 5
Wend
End Sub

Private Sub cmdexit_Click()
x = MsgBox("Anda Ingin Keluar Dari Form Ini?", vbQuestion + vbYesNo, "Informasi")
If x = vbYes Then
End
End If
End Sub

Blog Archive

Blogroll