Error 13 Type Mismatch again...HELP PLEASE

  • Thread starter Thread starter shmoussa
  • Start date Start date
S

shmoussa

Hi. I've had this error before, and have had no luck fixing it this
time....although I've narrowed it down. The problem lies here
somewhere:

strSQL = "SELECT [Disk Information].[File Name], [Disk Information].
[Volume Name], [Disk Information].[Volume Size], [Disk Information].
[Space In Use] " & _
"FROM [Disk Information] " & _
"GROUP BY [Disk Information].[File Name], [Disk Information].[Volume
Name], [Disk Information].[Volume Size], [Disk Information ].[Space In
Use] " & _
"HAVING ((([Disk Information].[File Name]) Not Like " * SHAREDNCS *
")) " & _
"ORDER BY [Disk Information].[Volume Name]; "


I also have this on top: Dim strSQL As String

What I am trying to do is filter my table to anything with a file name
that does not contain the word SHAREDNCS.

Any idead? Thanks.
 
hi,
Hi. I've had this error before, and have had no luck fixing it this
time....although I've narrowed it down. The problem lies here
somewhere:
"HAVING ((([Disk Information].[File Name]) Not Like " * SHAREDNCS *
")) " & _
As the double quotes are string limiters in VBA you need to either
escape them for your SQL or use the single quotes, e.g.

"HAVING [Disk Information].[File Name] Not Like ' * SHAREDNCS * ' " & ..


mfG
--> stefan <--
 
Back
Top