I just finished part one of Developer 31. The Pickfile works fine. The Dir function also works fine unless there is a comma in a folder or file name. I have googled till I can't see straight and the only solution I have seen (that actually works) is renaming everything. Is there a class that addresses this issue? Or am I just stuck with renaming?
I am the volunteer clerk for a cemetery. All the folders and files I inherited are named "Doe, John" or "Smith, Jane - Obituary". The 70-80 year old guys that devised this file system aren't really computer literate, and commas work fine in file explorer, so... it is what it is LOL.
There are quotes around the file path (CurrentPath & "*.*", vbNormal) and same with vbDirectory. All my other files work fine. It's only the ones with commas that don't work. I don't expect anyone to spend time on this. If there isn't a known fix, I'll dig in and find another way 😊
I do have to say, this site is amazing. I am loving the ABCD DB and have been able to configure it to my own personal needs. I haven't done anything with access for years. I'm relearning, but with much more depth. Thank you for all your hard work!!
Kevin Robertson
@Reply 4 years ago
The problem is Access is using that comma as a column separator. Add this block before the line that adds the filename to the list box.
If InStr(FN, ",") > 0 Then
FN = """" & FN & """"
End If
Do the same for the folders.
JoAnn BrookoverOP
@Reply 4 years ago
You are my favorite person in the whole world today! I tried several variations of the double quotes, but nothing worked. Your code works perfectly. Thank you!!
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 31.