Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Directory Copy - Pls. help

Status
Not open for further replies.

vmaruv

Programmer
Apr 8, 2002
102
US
hi,

I have a problem with my directory copy program. When I encounter insuffient privileges to copy the files in the directory, i want it to prompt and exit the operation.

But what I see is that it prompts as many times as the number of files. if there are 5 files in the directory with insuffient privileges then the message box is being shown 5 times. how can i resolve this.
Below is my code

If Err.Number = 75 Then
If InStr(Err.Description, "Path/File access error") > 0 Then
MsgBox "Path/File Access error ! Make sure you have enough privileges to perform this operation", vbCritical, "Copy Error"
Exit Sub
End If
 
It worked for me..thank you. I used a flag in my program and checking for it to be true in the calling program.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top