Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Another Syntax Problem
' .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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Another Syntax Problem
Thanks again Tom, that was exactly the help I needed.
Sincerely, Sharlene England |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem with Syntax? | Excel Worksheet Functions | |||
PLS HLP! Countifs Syntax Problem? | Excel Worksheet Functions | |||
Delete syntax problem | Excel Worksheet Functions | |||
.XValues syntax problem | Charts and Charting in Excel | |||
Syntax problem | Excel Worksheet Functions |