I am trying to deceiver this code here to see why a process is causing an invalid scan. This had previously been working but it reached its 2 GB limit and started having issues. I ran the compact and repair and it worked but I am still having issues with this code. I scan a sample ticket that reads like this
1 04 0331 83233 01. I can't scan the full number to the table without an invalid scan. This table is then exported to a flash drive then entered in a mainframe. Here is the code
Option Compare Database
Dim ScanTimeVar, StoreVar, LookUpVar ', CurrentVar, DiffVar
Private Sub Form_Load()
ScanTimeVar = Now()
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub Scan_BeforeUpdate(Cancel As Integer)
Forms![ScannerForm-Main]![LastTime] = Now()
StoreVar = (Mid(Me![Scan], 4, 4))
If IsNull(StoreVar) = False And IsNumeric(StoreVar) = True Then
StoreVar = Int(StoreVar)
LookUpVar = DLookup("STORE", "OpenStores", "STORE = " & StoreVar)
Else
LookUpVar = Null
End If
If Left(Me![Scan], 3) <> "104" Or Len(Me!Scan) <> 14 Or IsNull(LookUpVar) = True Then
Beep
Beep
Beep
Beep
Beep
MsgBox "Invalid Scan", vbCritical
Beep
Beep
Beep
Beep
Beep
'SendKeys "{Esc}"
'Me!Scan = Null
DoCmd.CancelEvent
SendKeys "{Esc}"
SendKeys "{Esc}"
End If
End Sub
Any suggestions?
I have tried removing the If left statement that was sending the invalid scan but then I am not able to import that scan into the mainframe.
Thanks,
Nick