I am trying to get this module to work within my Access2000 macro and it works the first time, however, if I physically delete the acadian.che file (for testing purposes), then I never can get to the part where I need to rename to acadian.txt once I add pass the acadian.che file. I believe that my "vbRetryCancel" is what's going on. I don't know if I need something to make the program loop back to the top to check for the file or what.
Basically I am taking records from the acadian.che file (but it has to be named acadian.txt) and then trying to delete the acadian.txt file so that it isn't used again. I was having a problem because the file wouldn't overwrite the acadian.txt file, so I put these if statements in to check if the files exist.
I am relatively new at this, so any help would be appreciated.
Public Function RenAcadianChe()
If Dir("c:\\imdata\acadian.che"
= "" Then
MsgBox "The Health Insurance check inport file (acadian.che) does not exist. Please save the file to the \\GL_Server1\GLExpData share to continue.", vbRetryCancel
Else
If Dir("c:\\imdata\acadian.txt"
<> "" Then
Kill "c:\\imdata\acadian.txt"
Name "c:\\imdata\acadian.che" As "c:\imdata\acadian.txt"
End If
End If
End Function
Basically I am taking records from the acadian.che file (but it has to be named acadian.txt) and then trying to delete the acadian.txt file so that it isn't used again. I was having a problem because the file wouldn't overwrite the acadian.txt file, so I put these if statements in to check if the files exist.
I am relatively new at this, so any help would be appreciated.
Public Function RenAcadianChe()
If Dir("c:\\imdata\acadian.che"
MsgBox "The Health Insurance check inport file (acadian.che) does not exist. Please save the file to the \\GL_Server1\GLExpData share to continue.", vbRetryCancel
Else
If Dir("c:\\imdata\acadian.txt"
Kill "c:\\imdata\acadian.txt"
Name "c:\\imdata\acadian.che" As "c:\imdata\acadian.txt"
End If
End If
End Function