Error 13 Type Mismatch again...HELP PLEASE

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.
 
S

Stefan Hoffmann

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 <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top