View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Another Syntax Problem

"WHERE (MILLINFO.CUSTCODE='" & Range("B9").Value & "')"

Note the single quotes included in the the strings on either side of the
cell reference.

--
Regards,
Tom Ogilvy


"Sharlene England" wrote in message
...
' .CommandText = Array( _
' "SELECT MILLINFO.PROJ_NAME, MILLINFO.PROJ_DIV,

MILLINFO.PROJ_STLOC,
MILLINFO.PROJ_ADDRS, MILLINFO.PROJ_LOC, MILLINFO.PROJ_PROV,
MILLINFO.PROJ_POST" & Chr(13) & "" & Chr(10) & "FROM
`K:\DATA\DBDATA\JOBDATA`\MILLINFO.DBF MILLINFO" & Chr(13) & "" & Chr(10) &
"WHERE (MILLINFO.CUSTCODE='FCA')" _
' )


The above line is a part of a macro that I am writing. I need to

substitue
the 'FCA' for a cell reference in my worksheet.

It keeps saying Type mismatch. Can't quite get the correct syntax.

Any help would be greatly appreciated.

Thanks in advance.