UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Dlookup Adds A Question Mark, Access 2016    
 
   
andywal6
post Oct 12 2019, 03:16 AM
Post#1



Posts: 179
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.......
Go to the top of the page
 

Posts in this topic



Custom Search


RSSSearch   Top   Lo-Fi    7th April 2020 - 08:51 PM