B
bchase
I am using Access 2003 and am receiving the above error for the following code:
Public Sub AddFilenamesToTable(folderspec)
Dim fs, fsFolder, fsFile, fsListOfFiles
Dim strFilename As String, strSQL As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set fsFolder = fs.GetFolder(folderspec)
Set fsListOfFiles = fsFolder.files
For Each fsFile In fsListOfFiles
strFilename = fsFile.Name
If DCount("[EmployeeID]", "[tblUserDatabase]", "[strPictureFilename] =
'" & strFilename & "'") = 0 Then
strSQL = "INSERT INTO tblUserDatabase ( strPictureFilename, strConv,
strClean-Delete, strTess, strStatus, strComments )VALUES ('" & strFilename &
"', #" & fsFile.DateLastModified & "# ) ;"
CurrentDb.Execute strSQL
End If
Next
End Sub
Debug highlights CurrentDb.Execute strSQL
Any suggestions or help would be greatly appreciated!
Public Sub AddFilenamesToTable(folderspec)
Dim fs, fsFolder, fsFile, fsListOfFiles
Dim strFilename As String, strSQL As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set fsFolder = fs.GetFolder(folderspec)
Set fsListOfFiles = fsFolder.files
For Each fsFile In fsListOfFiles
strFilename = fsFile.Name
If DCount("[EmployeeID]", "[tblUserDatabase]", "[strPictureFilename] =
'" & strFilename & "'") = 0 Then
strSQL = "INSERT INTO tblUserDatabase ( strPictureFilename, strConv,
strClean-Delete, strTess, strStatus, strComments )VALUES ('" & strFilename &
"', #" & fsFile.DateLastModified & "# ) ;"
CurrentDb.Execute strSQL
End If
Next
End Sub
Debug highlights CurrentDb.Execute strSQL
Any suggestions or help would be greatly appreciated!