My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
Posts: 169 Joined: 11-January 08 ![]() | Hi Al I'm using the code below to check if a Folder exists, and if not, create one, but for some reason the DLookup adds a '?' to the beginning of the result. CODE Debug.Print DLookup("[FoldersLocation]", "Company") If Dir(DLookup("[FoldersLocation]", "Company") & "\" & Forms![HostData]![HostID], vbDirectory) = "" Then MkDir (DLookup("[FoldersLocation]", "Company") & "\" & Forms![HostData]![HostID]) End If The 'IF Dir' line causes an error which says " Bad File name or number " I put the Debug line to check and its result is: ?C:\UKGuardiansDB\HostFolders Which is correct except for the question mark in front which incidentally, is not in that table field . The [HostID] comes up with the correct result Any thoughts would be appreciated. Andy....... |
![]() Post#2 | |
![]() Posts: 1,510 Joined: 2-April 09 From: somewhere out there... ![]() | just maybe there are non-printable characters in your FolderLocation field. try deleting the record and type again the location in that field. -------------------- Never stop learning, because life never stops teaching. |
![]() Post#3 | |
Posts: 169 Joined: 11-January 08 ![]() | Hi arnelgp Many thanks for your observation, you were quite correct. This come from being lazy and copying the address from the folders Properties. Best regards Andy....... |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 16th December 2019 - 08:03 AM |