Public Sub PasscodeOK()
Dim Amount As Currency
Dim Passcode As String
Dim Validity As Date
Dim recrst As New ADODB.Recordset
Dim InputPasscode As String
CLientUsed = "Used"
InputPasscode = Val(txtpasscode.Text)
If txtpasscode <> "" Then
Set recrst = New ADODB.Recordset
With recrst
.Open "Select * From Passcode where Passcode='" & InputPasscode & "'", con
'if i remove the Passcode = !Passcode, the error continues at the next line... which is the Amount = !Amount
Passcode = !Passcode
Amount = !Amount
Validity = !Validity
If Passcode <> txtpasscode.Text Then
MsgBox "Invalid Passcode!", vbInformation + vbOKOnly, "Try Again"
ElseIf Amount = FormatNumber(0, 2, True, True, True) Then
MsgBox "You do not have enough money left in your account!", vbInformation + vbOKOnly, "Load Status"
ElseIf Validity <= Now Then
MsgBox "Your Ticket is Already Expired!", vbInformation + vbOKOnly, "Ticket Status"
Else
frmterminal.lblamount.Caption = FormatNumber(!Amount, 2, True, True, True)
.Close
.Open "Select * from ClientLoad", con
con.Execute "Update ClientLoad Set Term_Status='" & CLientUsed & "' Where Terminal_ID='" & WinControl.LocalHostName & "'"
Me.Hide
Unload frm_main
frmterminal.Show
frmterminal.lblstatus.Caption = !Term_Status
frmterminal.lblterminal.Caption = WinControl.LocalHostName
frmterminal.lbltime.Caption = TimeValue(Now)
timerterminal.Enabled = True
DisableCAD (False)
End If
End With
Else
MsgBox "Please enter your passcode!", vbOKOnly + vbInformation, "Try Again!"
End If
End Sub