I can scan a 1 page document or a photo without a problem. I am trying to scan a multipage document and am running into a Memory cannot be "read" error thrown by MSACESS. I have a 2 page document. The second page goes through the scanner and then the error pops up and Access is then shut down. Has anyone run across anything like this?
Here is my code:
'Prepare scanner '======================================== 'Check to make sure Scanner is Online retVal = ImScan.GetCapability(ImTwain80Ctl.Capabilities.Device_Online, var, lDataType) If retVal = False Then
MsgBox "Scanner must be turned on.", vbCritical, "Scan A Document"
Exit Sub
End If retVal = ImScan.NegotiateCapability(Capabilities.Auto_Feed, True) 'Clear buffers retVal = ImScan.SetCapability(Capabilities.Clear_Buffers, True, Bool) If Me.[optMultiPage] = False Then
Me.ImScan.MaxPages = 1
Else
Me.ImScan.MaxPages = CInt(Me.txtPages)
End If ImageMan.AppendImage = True hDIB = ImScan.ScanPage(Me.[chkShowScannerSetup]) Me.ImScan.TransferMode = Memory While (hDIB <> 0)
ImageMan.hDIB = hDIB
ImageMan.SaveAs (strFileName)
i = i + 1 ' number of pages
' scan successive pages
hDIB = ImScan.ScanPage(False)
Wend ImScan.CloseSource