If you only want the form to open if the file exists then use this on the calling form:
Code:
If Dir(CurrentProject.Path & "\_readme.txt")<> "" Then
DoCmd.OpenForm "Your form name"
Else
MsgBox "The _Readme.txt file was not found." & vbCrLf & "The file must be in the same location as the database.", vbCritical, "File not found"
End If
Next move the rest of your code to the Form_Load event - Form_Open isn't appropriate for this
Code:
Private Sub Form_Load()
Me.txtVersionHistory = ReadTextFile(CurrentProject.Path & "\_readme.txt")
With Me.txtVersionHistory
.SetFocus
.SelStart = Len(.Text)
End With
End If
End Sub
Doing this solves your issue of closing the form
BTW - the file can be located somewhere else if preferred,
Just use the actual folder path or a variable for that value instead of CurrentProject.Path
Also recommend you don't start file names with an underscore