Contoh Aplikasi Sederhana
Private Sub Combo1_click()
If Combo1.Text = "kelas 1" Then
Text5.Text = 650000
ElseIf Combo1.Text = "kelas 2" Then
Text5.Text = 500000
ElseIf Combo1.Text = "bungalow 1" Then
Text5.Text = 3000000
ElseIf Combo1.Text = "bungalow 2" Then
Text5.Text = 4000000
End If
Text6 = 0.05 * Text5
Text7 = Text5 - Text6
Text8 = 0.1 * Text7
Text9 = Val(Text7) + Val(Text8)
End Sub
Private Sub Command1_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Combo1 = ""
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset!kodetransaksi = Text1.Text
Adodc1.Recordset!namacostumer = Text2.Text
Adodc1.Recordset!alamatlengkap = Text3.Text
Adodc1.Recordset!tanggal = Text4.Text
Adodc1.Recordset!hargapenginapan = Text5.Text
Adodc1.Recordset!pelayan = Text6.Text
Adodc1.Recordset!subharga = Text7.Text
Adodc1.Recordset!pajak = Text8.Text
Adodc1.Recordset!totalharga = Text9.Text
Adodc1.Recordset.Update
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.Delete
End Sub
Private Sub Command5_Click()
Adodc1.Recordset!kodetransaksi = Text1.Text
Adodc1.Recordset!namacostumer = Text2.Text
Adodc1.Recordset!alamatlengkap = Text3.Text
Adodc1.Recordset!tanggal = Text4.Text
Adodc1.Recordset.Update
End Sub
Private Sub Command6_Click()
Adodc1.Recordset.Find "kodetransaksi='" + Text1.Text + "'", , adSearchForward, 1
If Not Adodc1.Recordset.EOF Then
Text1.Text = Adodc1.Recordset!kodetransaksi
Text2.Text = Adodc1.Recordset!namacostumer
Else
MsgBox "Maaf, Data Tidak Ditemukan!"
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1
Text4.Text = Date
Adodc1.ConnectionString = "Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\user\My Documents\o\kisi.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from kisi"
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Option1_Click()
Combo1.Clear
Combo1.AddItem ("kelas 1")
Combo1.AddItem ("kelas 2")
End Sub
Private Sub Option2_Click()
Combo1.Clear
Combo1.AddItem ("bungalow 1")
Combo1.AddItem ("bungalow 2")
End Sub
Private Sub Timer1_Timer()
Label11.Caption = Time
End Sub



0 komentar: