Dir() function does not work in a textbox

B

billyocean

I've got a lot of Access and VBA experience but this has me totally stumped.

I have one user who gets a #Name? error in textboxes that use the dir()
function.

The original control source of the textbox is

=IIf(Len(Dir("T:\Claims\" & [carrier] & "\claim " & Left([claim register],7)
& "; " & [pro] & "\cost.*"))>0,[blocks],"")

of course when that turned into errors after almost 2 years of using this
form without incident I changed the source on her front end to read
=dir("c:\")

returns the same error.

I put a button on the same form with this code

msgbox dir("c:\")

and it worked fine, displayed autoexec.bat

I tried a custom function to return True if the file I'm checking for is
found, but that gave the same error. I then replaced that function to just
return True and that still gave the same error.

I'm really confounded so any ideas would be appreciated. Thanks very much
 

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