Input past end of File, what does that mean ?

RompStar

Well-known Member
Joined
Mar 25, 2005
Messages
1,200
So I use Access, someone who isn't here no more made a Metrics System using Access, and there is a FORM that I use to input a textfile.txt file into Access.

After doing it's thing, at the end, a window pops up saying:

"Input past end of file"

What does this mean ?

Thank you for your help.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
It means what it says really.:)

Whatever method is being used to import the file is trying to import past the end of the file.

To give more specific information we would need to see the code, if any, that is doing the import.
 
Upvote 0
Do you think it hurts to import past the end of the file ? or is that just an general warning error that Access spits out ?
 
Upvote 0
It is something that you really should be concerned about. It is not "just a general warning error" but is something that should not be happening. As Norie said, posting the code that is doing the import would really help us help you.
 
Upvote 0
I don't know if it will necessarily 'hurt' but I would recommend that you try and find why you are getting the error and the eliminate.

In general I think it's a good idea to fix code if it's broken.:)
 
Upvote 0
Here is the code from the FORM, I see 3 sub routines, but I am not an expert of Access VBA, know more with Excel VBA, that's why some of this looks familiar.

code start below the line:

_________________________________________________

Option Compare Database
Option Explicit

Private Sub cmdISSOBX_Click()
Dim SQL As String

On Error GoTo Err_End

CursorHourGlass

ADOCurrentProjectConnect 'Set Cnn2 and Cmd to Current Project

LoadVar 'filename for Msmarket scan and date range for APSS History and Receipt Scan ISS Receipt tables

CreateTableTempShip 'Temporary table to hold APSS shipping records

CreateTableTempMsmarketPickup 'Temporary table to hold MsmarketScan (flat file) records
'that = 42 OR 21 which are pickup scans
CreateTableTempMsmarketDropoff 'Temporary table to hold Msmarket Scan (flat file) records that = 41 OR 22
'that = 41 OR 22 which are dropoff scans
CreateTableTempMsmarketIssReceipt 'Temporary table to hold RECEIPT SCAN "ISS Receipt" table
'records which are walk-in dropoff scans
CreateTableTempMsmarketObxReceipt 'Temporary table to hold RECEIPT SCAN "OBX Receipt" table
'records which are walk-in dropoff scans
CreateTableTempObxConsol

PopulateTempMsmarketDropoff_Pickup 'Populate the TempMsmarketDropoff and TempMsmarketPickup tables with values
'from Msmarket Scan csv. file
SetCnnConnection "Data Source=C:\RECEIPT SCAN.mdb" 'Set cnn connection to the RECEIPT SCAN Database

PopulateTempMsmarketIssReceipt 'Populate the TempMsmarketIssReceipt table with values
'from RECEIPT SCAN "ISS Receipt" table
PopulateTempObxConsol

PopulateISSConSolVol 'Populate the ISSCONSOLVOL Table

PopulateOBXConSolVol 'Populate the OBXCONSOLVOL Table

PopulateTempMsmarketObxReceipt 'Populate the TempMsmarketObxReceipt table with values
'from RECEIPT SCAN "OBX Receipt" table
cnn.Close

SetCnnConnection "Data Source=c:\apsshistory" & _
";Extended Properties=DBase IV" 'Set cnn connection to the APSS DbaseIV database file
PopulateTempship 'Populate the TempShip table with values
'from APSS DbaseIV database file
'cnn.Close

'SetCnnConnection "Data Source=c:\apssfreight" & _
";Extended Properties=DBase IV" 'Set cnn connection to the APSS freight DbaseIV database file

' PopulateTempshipFreight 'Populate the TempShip table with values
'from APSS freight DbaseIV database file
UpdateTempShipPickdate 'Update TempShip pickup (datetime) field from TempMsmarketPickup pickup (datetime) field

UpdateTempShipDropdate 'Update TempShip dropoff (datetime) field from TempMsmarketDropoff dropoff (datetime) field

UpdateTempShipIssRecdate 'Update TempShip pickup (datetime) field from TempMsmarketIssReceipt dropoff (datetime) field

UpdateTempShipObxConsol

UpdateTempShipObxRecdate 'Update TempShip pickup (datetime) field from TempMsmarketObxReceipt dropoff (datetime) field

UpdateTemShipPriority 'Update TempShip table priority field to one of five priority levels


CalISSNonCon 'Calculate non-conformances for ISS

CalOBXNonCon 'Calculate non-conformances for OBX

PopulateISSOBXVOL

DropTempTables

CloseConnection

CursorNormal

MsgBox ("Complete")
Exit Sub

Err_End:

ErrEndConnect
End Sub

Private Sub cmdRecDist_Click()
On Error GoTo Err_End

CursorHourGlass

ADOCurrentProjectConnect 'Set Cnn2 and Cmd to Current Project

' CreateTempDockside

' PopulateTempDockside

PopulateTableRECDISVOL 'Populate the RECDISVOL table from the CRMS Receiving csv file

'UpdateRecdisVolDockside

CalRecNonConv1 'Calcaulate non-conformances from Receiving csv file and
'populate RECNON with non-conformance records
CalDisNonConv2 'Calcaulate non-conformances from Receiving csv file and
'populate DISNON with non-conformance records
'DropTempDockside

CloseConnection

CursorNormal

MsgBox ("Complete")
Exit Sub

Err_End:

ErrEndConnect
End Sub


Sub ErrEndConnect()
If (cnn.State = adStateOpen) Then
cnn.Close
End If

Set cnn = Nothing

If (cnn2.State = adStateOpen) Then
cnn2.Close
End If

Set cnn2 = Nothing

Close #1

CursorNormal

MsgBox (Err.Description)

End Sub
 
Upvote 0
This FORM has two button on it, the one that I get an error from is for the Sub Routine Sub cmdRedDist_click() that button feeds a textfile.txt

the other sub don't give me an error, and the error handling seems basic to me too.

Please let me know what you think.
 
Upvote 0
That isn't all the code I'm afraid.

As far as I can see all of these are calls to other subroutines.
Code:
CursorHourGlass
ADOCurrentProjectConnect
LoadVar
CreateTableTempShip
CreateTableTempMsmarketPickup
CreateTableTempMsmarketDropoff
CreateTableTempMsmarketIssReceipt
CreateTableTempMsmarketObxReceipt
CreateTableTempObxConsol
PopulateTempMsmarketDropoff_Pickup
PopulateTempMsmarketIssReceipt
PopulateTempObxConsol
PopulateISSConSolVol
PopulateOBXConSolVol
PopulateTempMsmarketObxReceipt
PopulateTempship
UpdateTempShipPickdate
UpdateTempShipDropdate
UpdateTempShipIssRecdate
UpdateTempShipObxConsol
UpdateTempShipObxRecdate
UpdateTemShipPriority
CalISSNonCon
CalOBXNonCon
PopulateISSOBXVOL
DropTempTables
CloseConnection
CursorNormal
And that's just for the first button.:)
 
Upvote 0
Here is one of the calls, this is the one that runs for the textfile.txt when I press the button, let me know if you need to see more...

Sub PopulateTableRECDISVOL()
Dim removeHeader As String
Dim pkgid As String
Dim tracknum As String
Dim priority As String
Dim indate As String
Dim procdate As String
Dim deldate As String
Dim carrier As String

On Error GoTo Err_Duplicate
Do
filename = InputBox("Enter Receiving Filename (filename.ext)", "Receiving File")
If filename = "" Then
MsgBox "Enter Filename", vbOKOnly, "ERROR"
End If
Loop Until filename <> ""
CursorHourGlass
filename = path & filename
rst.Open "RECDISVOL", cnn2, adOpenKeyset, adLockOptimistic, _
adCmdTableDirect
Open filename For Input As #1
' Input #1, removeheader, removeHeader, removeHeader, removeHeader, removeHeader, removeHeader, removeHeader' REMOVE HEADER
Do While Not EOF(1)
Input #1, pkgid, tracknum, carrier, priority, indate, procdate, deldate 'WILL NEED TO ADD CARRIER VARIABLE
rst.AddNew
rst!pkgid = pkgid
rst!tracknum = tracknum
rst!priority = priority
rst!indate = indate
rst!procdate = procdate
rst!deldate = deldate
rst.Update
rst.CancelUpdate
Loop
If rst.EOF = True Then
'DO nothing
ElseIf rst.EditMode = adEditAdd Then
rst.CancelUpdate
End If
rst.Close
Close #1
Exit Sub
 
Upvote 0
Romp Star

I think what you need to do is use the debugger to find out where the error is and work from there.

I also think it's going to be nigh on impossible to give you any useful help as it will be very hard to recreate your situation.

Whoever originally create this code should have accounted for this happening.

PS If you want a quick fix you might get away with just putting this at the top of the code.
Code:
On Error Resume Next
But that will just ignore the error not fix it.:)
 
Upvote 0

Forum statistics

Threads
1,213,492
Messages
6,113,967
Members
448,537
Latest member
Et_Cetera

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top