Source Code Membuat Aplikasi Penjualan Tiket Kereta Api
Buat tampilan seperti dibawah ini
Kemudian masukan script dibawah ini
Private Sub CmdKeluar_Click()
Unload Me
End Sub
Private Sub CmdLagi_Click()
TxtKt.SetFocus
TxtKt = ""
TxtHt = ""
TxtJk = ""
TxtJb = ""
TxtJt = ""
TxtTotal = ""
End Sub
Private Sub CmdProses_Click()
Dim Kode, Harga, Jenis, Berangkat As Variant
Kode = Left(TxtKt.Text, 3)
Select Case Kode
Case "BIM"
Harga = 50000
Jenis = "BIMA"
Berangkat = "16.00"
Case "EKO"
Harga = 35000
Jenis = "EKONOMI"
Berangkat = "19.00"
Case "MUT"
Harga = 23000
Jenis = "MUTIARA"
Berangkat = "17.00"
Case "SEN"
Harga = 15000
Jenis = "SENJA"
Berangkat = "20.00"
End Select
TxtHt = Harga
TxtJk = Jenis
TxtJb = Berangkat
TxtJt.SetFocus
End Sub
Private Sub TxtJt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtTotal = Val(TxtHt.Text) * Val(TxtJt.Text)
End If
End Sub
Kemudian masukan script dibawah ini
Private Sub CmdKeluar_Click()
Unload Me
End Sub
Private Sub CmdLagi_Click()
TxtKt.SetFocus
TxtKt = ""
TxtHt = ""
TxtJk = ""
TxtJb = ""
TxtJt = ""
TxtTotal = ""
End Sub
Private Sub CmdProses_Click()
Dim Kode, Harga, Jenis, Berangkat As Variant
Kode = Left(TxtKt.Text, 3)
Select Case Kode
Case "BIM"
Harga = 50000
Jenis = "BIMA"
Berangkat = "16.00"
Case "EKO"
Harga = 35000
Jenis = "EKONOMI"
Berangkat = "19.00"
Case "MUT"
Harga = 23000
Jenis = "MUTIARA"
Berangkat = "17.00"
Case "SEN"
Harga = 15000
Jenis = "SENJA"
Berangkat = "20.00"
End Select
TxtHt = Harga
TxtJk = Jenis
TxtJb = Berangkat
TxtJt.SetFocus
End Sub
Private Sub TxtJt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtTotal = Val(TxtHt.Text) * Val(TxtJt.Text)
End If
End Sub
Belum ada Komentar untuk "Source Code Membuat Aplikasi Penjualan Tiket Kereta Api"
Posting Komentar