D
Douglas J. Steele
To only have your code run when the file doesn't exist, you need
If Me.TxtFile = 0 Then
The Dir function returns the file name without its path if the file exists,
or a zero-length string ("") if the file doesn't exist.
If Me.TxtFile = 0 Then
The Dir function returns the file name without its path if the file exists,
or a zero-length string ("") if the file doesn't exist.