The following code attempted to open and read a nonexistent file, but did not act the way I thought it would. The intent is to generate the file if it does not already exist. I expected the On Error to direct Control Flow to FileError, but the bolded MsgBox Statement executed.
VB Code:
  1. On Error GoTo FileError
  2.  
  3. SuitFileNumber = FreeFile
  4. Open File_Name For Binary Access Read Lock Write As SuitFileNumber
  5. Get SuitFileNumber, 1, InputStamp
  6.  
  7. If InputStamp.ProjectName = FileStamp.ProjectName _
  8.         And InputStamp.AuthorFirst = FileStamp.AuthorFirst _
  9.         And InputStamp.AuthorLast = FileStamp.AuthorLast _
  10.         And InputStamp.RecordCount = 512 Then
  11.         'Fall through and read file'
  12.     Else
  13.         [b]Junk = MsgBox("File corrupted or not Suit Data File")[/b]
  14.         Close SuitFileNumber
  15.         ThereIsSuitData = False
  16.         Exit Function
  17.   End If
  18. [b]. . . [/b]
  19. FileError:
  20. [b]. . .[/b]
The above code is in a Function. I have included only the code which seems pertinent. File_Name is passed to the Function as parameter and seems to be syntactically correct.

App.Path & "SuitData.qqq" was used, and Debug analysis indicated that it became the name of a nonexistent file.

I expected the Open to fail, causing Control Flow to go to FileError. The input area looks like uninitialized data, indicating that no I/O actually occurred.

Why did neither the Open nor the Get cause control flow to go to FileError?

BTW: Due to the way some mainframes react, I always supply a place for values returned from Functions. Hence: Junk = MsgBox.