Error for one user with Dir Function

K

Kerry

Hi all,

For a procedure in a database (Access 2003), one user gets an error
message, but others do not. If I log on to his computer, I do not get
the error message. The error is Bad File Name or Number. This occurs
on the dir function below in the code sample, when the folder does not
exist.


Let strFolder = dir(strTemp, vbDirectory)

If Len(strFolder) = 0 Then
Let intResponse = MsgBox("Unable to find folder for " & strJob
& "." & vbCrLf & _
"Do you want to browse for the ad file?", vbInformation +
vbYesNo, "No Project Folder")
If intResponse = vbNo Then Exit Sub
Let varDirectory = "Q:\"
GoTo SelectAdFile
End If

Any suggestions as to why this happens? I am able to trap the error,
and work around the problem, but am curious as to why one user would
have this issue.
 
J

Jerry Whittle

Check that person's drive mappings. For example do they have a Q drive?

Also check their permissions to the drives.
 
K

Kerry

Hi Jerry,

Yes, that person has access to Q:\. The strTemp in the Dir(strTemp,
vbDirectory) does not exist, so neither I nor they have access to it,
but if I run the code, I get strFolder="", and they get the Bad File
error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top