Program Transaksi Pemesanan Tiket

Code :
Sub aktif()
Dim a As Control
For Each a In Me
If TypeName(a) = "TextBox" Then a.Enabled = True
Next
cash.Enabled = True
credit.Enabled = True
End Sub
Sub tidakaktif()
Dim b As Control
For Each b In Me
If TypeName(b) = "TextBox" Then b.Enabled = False
Next
cash.Value = False
credit.Value = False
End Sub
Sub bersih()
Dim c As Control
For Each c In Me
If TypeName(c) = "TextBox" Then c.Text = ""
Next
cash.Value = False
credit.Value = False
End Sub
Private Sub cash_Click()
diskon.Text = 0.05 * Val(subtotal.Text)
totbay.Text = Val(subtotal.Text) - Val(diskon.Text)
MsgBox "TranSaksi BeRhasiL..!1, HorRe", 64, "InFo"
tidakaktif
End Sub
Private Sub cmdinput_Click()
aktif
bersih
tanggal.Text = ""
bulan.Text = ""
tahun.Text = ""
kd_p.SetFocus
End Sub
Private Sub credit_Click()
diskon.Text = 0.02 * Val(subtotal.Text)
totbay.Text = Val(subtotal.Text) - Val(diskon.Text)
MsgBox "TranSaksi BeRhasiL..!1, HorRe", 64, "InFo"
tidakaktif
End Sub
Private Sub Form_Activate()
bersih
tidakaktif
cmdinput.SetFocus
End Sub
Private Sub cmdkeluar_Click()
w = MsgBox("Yakin B9d diBuan9???", vbYesNo, "WaRning")
If w = vbYes Then
End
End If
End Sub
Private Sub Form_Load()
Dim w As Integer
For w = 1 To 31
tanggal.AddItem (w)
Next
bulan.AddItem ("JanuAri")
bulan.AddItem ("FebRuari")
bulan.AddItem ("MareT")
bulan.AddItem ("aPriL")
bulan.AddItem ("Mei")
bulan.AddItem ("Juni")
bulan.AddItem ("Juli")
bulan.AddItem ("a9ustus")
bulan.AddItem ("SeftemBeR")
bulan.AddItem ("oKTober")
bulan.AddItem ("November")
bulan.AddItem ("DesemBeR")
tahun.AddItem Format(Date, "YYYY")
For w = 1 To 10
tahun.AddItem (Format(Date, "YYYY") + w)
Next
End Sub
Private Sub jumsan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
subtotal.Text = Val(hrgtiket.Text) * Val(jumsan.Text)
End If
End Sub
Private Sub kd_p_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If kd_p.Text = "GRD" Then
nm_psw.Text = "Garuda IndoNesia"
hrgtiket.Text = 85000
term.Text = "A"
Else
If kd_p.Text = "LIO" Then
nm_psw.Text = "Lion Air"
hrgtiket.Text = 75000
term.Text = "B"
Else
If kd_p.Text = "MND" Then
nm_psw.Text = "Mandala Air"
hrgtiket.Text = 65000
term.Text = "C"
Else
MsgBox "MAAF....,Kode PesawaT tIdak Terdaftar, Silahkan Jalan Kaki Z", vbCritical + vbOKOnly, "Warning"
kd_p.SetFocus
kd_p.Text = ""
End If
End If
End If
End If
End Sub
Private Sub term_Change()
jumsan.SetFocus
End Sub
Private Sub Timer1_Timer()
Labeltgl.Caption = Format(Date, "DDDD, DD MMMM YYYY")
Labelwaktu.Caption = Time
End Sub


