Sabtu, 20 Juni 2009

Rental Mobil Sejoli Sejati

Dim x As Control
Dim i As Integer
Private Sub bersih()
For Each x In Me
If TypeName(x) = "TextBox" Then
x.Text = ""
ElseIf TypeName(x) = "ComboBox" Then
x.Text = ""
End If
Next
End Sub
Private Sub hidup()
For Each x In Me
If TypeName(x) = "TextBox" Then
x.Enabled = True
ElseIf TypeName(x) = "ComboBox" Then
x.Enabled = True
End If
Next
End Sub
Private Sub mati()
For Each x In Me
If TypeName(x) = "TextBox" Then
x.Enabled = False
ElseIf TypeName(x) = "ComboBox" Then
x.Enabled = False
End If
Next
End Sub

Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
a = Val(Combo1.Text)
b = Val(Combo2.Text)
Text6.Text = b - a
End If
End Sub

Private Sub Command1_Click()
Label14 = Val(Text6.Text) * Val(Text8.Text)
End Sub

Private Sub Command2_Click()
bersih
hidup
auto
End Sub

Private Sub Command3_Click()
With Data3.Recordset
.AddNew
!Nosewa = Text1.Text
!Tglsewa = Combo1.Text
!Tglkembali = Combo2.Text
!Kdmobil = DBCombo2.Text
!Noanggota = DBCombo1.Text
.Update
End With
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub DBCombo1_Change()
With Data1.Recordset
.Index = "anggotadex"
.Seek "=", DBCombo1
If Not .NoMatch Then
Text2.Text = !Nmanggota
Text9.Text = !Alamat
End If
End With
End Sub

Private Sub DBCombo2_Change()
With Data2.Recordset
.Index = "mobildex"
.Seek "=", DBCombo2
If Not .NoMatch Then
Text3.Text = !Merkmobil
Text4.Text = !Jenismobil
Text5.Text = !Nopolisi
End If
End With
End Sub

Private Sub Form_Load()
mati
bersih

For i = 1 To 30
Combo1.AddItem Format(Date + i, "dd/mm/yyyy")
Next
Combo1.Text = Format(Date + i, "dd/mm/yyyy")

For i = 1 To 30
Combo2.AddItem Format(Date + i, "dd/mm/yyyy")
Next
Combo2.Text = Format(Date + i, "dd/mm/yyyy")
End Sub

Private Sub Option1_Click()
Text8.Text = 250000
End Sub

Private Sub Option2_Click()
Text8.Text = 100000
End Sub

Private Sub Timer1_Timer()
Label2 = Date
Label3 = Time
End Sub
Private Sub auto()
With Data3.Recordset
If RecordCount <> 0 Then
.MoveLast
nolama = !Nosewa
no = nolama + 1
Else
no = 1
End If
End With
nobaru = ("000" & Trim(no))
Text1.Text = Trim(nobaru)
End Sub

Mau Download program ini klik link di bawah ini :
http://www.indowebster.com/Rental_Mobil.html

Tidak ada komentar:

Posting Komentar