I am having a bit of a problem with a program I am working on. The person I am writing it for has asked if I could take a file in text format and copy certain information from it into different tables in a database. I thought "No problem". I ran into something that I cannot figure out how to fix though. There are certain records in the text file that do not contain 2 fields that all the other records have. So when the program reads the file and starts assigning the fields to variables, it doesn't recognize that this has happened, and I get a runtime error. Here is what my code looks like:

Do Until EOF(3)

Input #3, pstrIO, pstrPCMSid, pstrForeignSid, pstrDelete1, pstrDelete2,pstrCalls, pcurAirDollars, pcurTax1, pcurTax2, pcurSurDollars, pcurTollDollars, curTotalDollars, pstrSurcharges, pstrNS, pstrDelete3, pstrAirMou

Some of the records are missing the pstrdelete3 field and pstrAirMou field. If the program reads a record that is missing this field, it takes the first two fields from the next record and assigns these variables with those fields.
Is there a way to make it so that the program will stop reading a record when there are no more fields? Any help is greatly appreciated!!!!!