Help! - Error Handling Problem 
Author Message
 Help! - Error Handling Problem

I am trying to determine if a file exists in a certain location by
using Filecopy. I copy the file to a different location under a generic
name and if I get an error, I know the file doesn't exist. Here's the
code....
***********************
On Error GoTo FilenotFound

FileCopy "\\server1\users\inst_data\array_data\" & arrayserial &
".xls", "c:\temp\tempcap.xls"
*******************************8

It gets wierd though...The first time I have an error, it behaves as
expected and goes to "filenotfound".

On the second pass, if there is an error, it stops execution and gives
me an error window. ARRRGGHHH! WHAT IS HAPPENING!

Thanks in advance...

--== Sent via Deja.com http://www.*-*-*.com/
---Share what you know. Learn what you don't.---



Sat, 03 Nov 2001 03:00:00 GMT  
 Help! - Error Handling Problem

Quote:

> I am trying to determine if a file exists in a certain location by
> using Filecopy. I copy the file to a different location under a generic
> name and if I get an error, I know the file doesn't exist. Here's the
> code....
> ***********************
> On Error GoTo FilenotFound

> FileCopy "\\server1\users\inst_data\array_data\" & arrayserial &
> ".xls", "c:\temp\tempcap.xls"
> *******************************8

> It gets wierd though...The first time I have an error, it behaves as
> expected and goes to "filenotfound".

> On the second pass, if there is an error, it stops execution and gives
> me an error window. ARRRGGHHH! WHAT IS HAPPENING!

Why not use the Dir() function to determine if a file exists?  Check it out
in the Access help files.

--
-------------------------
| gHaD (Aaron Robinson) |
|MJM-PC Solutions, Inc. |
|      Chicago, IL      |
-------------------------



Sat, 03 Nov 2001 03:00:00 GMT  
 Help! - Error Handling Problem
You might wish to look at the On Error help topic. I am no expert, but I
suppose it meight be that you aren't resetting the error handler once it has
been activated.
Quote:

>It gets wierd though...The first time I have an error, it behaves as
>expected and goes to "filenotfound".

>On the second pass, if there is an error, it stops execution and gives
>me an error window. ARRRGGHHH! WHAT IS HAPPENING!



Sun, 04 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. *** HELP : Error Handling Problem

2. ***HELP : Error Handling Problem Using RDO

3. Help, Error handling errors

4. Error Handling (Handle by number)

5. Error Handling Is not Handling

6. Access 2000 : Error handling/debugging problems

7. Problem with Run-Time Error Handling

8. Custom error handling problem

9. Error handling problems...

10. Problem VB4 RDO, Multiple Selects for Stored Proc Error Handling

11. Error handling problem??

12. ERROR handling problem

 

 
Powered by phpBB® Forum Software