You are on page 1of 11

Daryl lou Abugadie Bsit301 Fom1 Dim TimeIn As Integer Dim TimeOut As Integer Const times As Double = 40 Dim

Total As Integer Dim park As Integer Dim ans As Variant Dim money As Double Dim change As Double Dim a As Double Dim tp As Double Const motor As Double = 25 Private Sub cmdadd_Click() Text1.Locked = False Text2.Locked = False Text3.Locked = False Text4.Locked = False Text5(0).Locked = False Text5(1).Locked = False Text5(2).Locked = False Text5(3).Locked = False Textt5(4).Locked = True Command1.Enabled = True Command2.Enabled = True Command3.Enabled = True Text1.SetFocus End Sub Private Sub cmdCompute_Click() a = Val(Text7.Text) Total = Val(Text5(3).Text) tp = a - Total Text5(5).Text = tp End Sub Private Sub cmddel_Click() If Not Adodc1.Recordset.EOF Then If MsgBox("Do you want to delete this record?", _ vbYesNo + vbQuestion, _ "Delete") = vbNo Then Exit Sub End If

Adodc1.Recordset.Delete Adodc1.Recordset.Requery End If End Sub Private Sub cmdsave_Click() Adodc1.Recordset.AddNew Adodc1.Recordset.Fields("Ticket Number") = Text1.Text Adodc1.Recordset.Fields("Name") = Text2.Text Adodc1.Recordset.Fields("Plate Number") = Text3.Text Adodc1.Recordset.Fields("Vehicles") = Text8.Text Adodc1.Recordset.Fields("Time in") = Text5(0).Text Adodc1.Recordset.Fields("Time out") = Text5(1).Text Adodc1.Recordset.Fields("Date") = Text6.Text Adodc1.Recordset.Fields("Total") = Text5(3).Text Adodc1.Recordset.Fields("Amount Paid") = Text7.Text Adodc1.Recordset.Fields("Change") = Text5(5).Text Adodc1.Recordset.Update Adodc1.Recordset.Requery MsgBox ("file completely save") Call clearAllfields End Sub Private Sub Command1_Click() Text5(0).Text = lblTime.Caption Command1.Enabled = True End Sub Private Sub Command2_Click() Text5(1).Text = lblTime.Caption Command2.Enabled = True 'If TimeOut - TimeIn < 1 Then 'ans = MsgBox("Our minimum parking time is 1 hour!!!", vbInformation) 'Text5(1).Text = "" 'Text5(1).Refresh 'End If End Sub

Private Sub Command3_Click() Text6.Text = lblDate.Caption Command3.Enabled = True End Sub Private Sub Command4_Click()

ans = MsgBox("You must pay double the price of your ticket rate!", vbInformation) Text5(3).Text = Text5(3).Text * 2 End Sub Private Sub optC_Click() Text8.Text = optC.Caption If optC.Value = True Then tp = times * 1 Text5(3).Text = tp End If End Sub Private Sub optM_Click() Text8.Text = optM.Caption If optM.Value = True Then tp = motor * 1 Text5(3).Text = tp End If End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 8: Case Else KeyAscii = 0 End Select End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 8: Case Else KeyAscii = 0 End Select End Sub Private Sub Text5_Change(Index As Integer) a = Val(Text7.Text) TimeIn = Val(Text5(0).Text) TimeOut = Val(Text5(1).Text) 'If Text6.Text = "" Then 'Text5(3).Text = ""

If Text5(1).Text = lblTime.Caption Then park = TimeOut - TimeIn 'Total = times * park If park < 1 Then Total = times * park ElseIf park > 1 Then Text5(3).Text = "P" + Format(Total, "##,###.00") End If End If Total = Val(Text5(3).Text) a = Val(Text7.Text) change = a - Total If Text7.Text = "" Then Text5(5).Text = "" ElseIf Text7.Text = a Then Text5(5).Text = "P" + Format(change, "##,###.00") End If

If optM.Value = Checked Then Total = Total End If End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 8: Case Else KeyAscii = 0 End Select End Sub Private Sub Timer3_Timer() Static x If x Then Me.Label10.ForeColor = vbWhite Else Me.Label10.ForeColor = vbBlack End If x = Not x End Sub

Private Sub Timer4_Timer() Static x If x Then Me.Label11.ForeColor = vbWhite Else Me.Label11.ForeColor = vbBlack End If x = Not x End Sub Private Sub Timer5_Timer() Static x If x Then Me.Label12.ForeColor = vbWhite Else Me.Label12.ForeColor = vbBlack End If x = Not x End Sub Private Sub Timer6_Timer() Static x If x Then Me.Label13.ForeColor = vbWhite Else Me.Label13.ForeColor = vbBlack End If x = Not x End Sub Private Sub Timer7_Timer() Static x If x Then Me.Label14.ForeColor = vbWhite Else Me.Label14.ForeColor = vbBlack End If x = Not x End Sub Private Sub Timer8_Timer() Static x If x Then Me.Label15.ForeColor = vbWhite Else Me.Label15.ForeColor = vbBlack End If x = Not x End Sub Private Sub Timer9_Timer()

Static x If x Then Me.Label16.ForeColor = vbWhite Else Me.Label16.ForeColor = vbBlack End If x = Not x End Sub Private Sub Timer1_Timer() lblTime.Caption = Time End Sub Private Sub Timer2_Timer() lblDate.Caption = Date End Sub log-in Public LoginSucceeded As Boolean Private Sub cmdenter_Click() Dim x As String Dim Y As String Dim z As Integer x = txtUser.Text Y = txtPass.Text If x = "daryllou" And Y = "abugadie" Then frmSplash.Show cmdenter.Enabled = False cmdCancel.Enabled = False Else a = MsgBox("Username or Password incorrect!", vbExclamation + vbOKOnly, "ERROR") txtUser.SetFocus txtUser.Text = "" txtPass.Text = "" lblout.Caption = Val(lblout.Caption) - 1 If Val(lblout.Caption) = 1 Then Label2.Caption = "WARNING Last Attempt!" Timer1.Enabled = True Timer2.Enabled = True Timer3.Enabled = True Timer4.Enabled = True ElseIf Val(lblout.Caption) = 0 Then Unload Me End If

End If End Sub Private Sub cmdCancel_Click() LoginSucceeded = False Me.Hide Unload Me End Sub Private Sub Timer1_Timer() Label2.ForeColor = vbRed End Sub Private Sub Timer2_Timer() Label2.ForeColor = vbYellow End Sub Private Sub Timer3_Timer() lblout.ForeColor = vbRed End Sub Private Sub Timer4_Timer() lblout.ForeColor = vbBlack End Sub Private Sub Form_Load() Timer3.Enabled = False Timer1.Enabled = False Timer2.Enabled = False Timer4.Enabled = False End Sub MDIform1 Private Sub Calculator_Click() Load frmCalculator frmCalculator.Show End Sub Private Sub DataReport_Click() DataReport1.Show vbModal End Sub Private Sub Exit_Click() Dim ans As String ans = MsgBox("Are You Sure You Want Exit?", vbYesNo, "Exit") If ans = vbYes Then End Else Cancel = 1 End If End Sub

Private Sub Games_Click() Load Form2 Form2.Show End Sub Private Sub System_Click() Load Form1 Form1.Show End Sub Splashform Option Explicit Private Sub Frame1_Click() Unload Me End Sub

Private Sub Timer1_Timer() Picture1.Visible = True Picture1.Width = Picture1.Width + 60 If Picture1.Width = Picture2.Width Then Timer1.Enabled = False End If End Sub Private Sub Timer2_Timer() ProgressBar1.Value = ProgressBar1.Value + 10 Label1.Caption = ProgressBar1.Value & "%" If ProgressBar1.Value = 100 Then Timer2.Enabled = False Unload Me MDIForm1.Show End If End Sub Private Sub Timer3_Timer() Static x If x Then Me.Label1.ForeColor = vbCyan Else Me.Label1.ForeColor = vbBlue End If x = Not x

End Sub

You might also like