ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can't get this syntax correct, please help. (https://www.excelbanter.com/excel-programming/284033-cant-get-syntax-correct-please-help.html)

Sharlene England

Can't get this syntax correct, please help.
 
I want to have the user type into cell A1 then the query will get the
correct information.

The following works:
"SELECT JOB_NO.CUSTCODE, JOB_NO.JOB_NO" & Chr(13) & "" & Chr(10) & "FROM
`K:\DATA\DBDATA\JOBDATA`\JOB_NO.DBF JOB_NO" & Chr(13) & "" & Chr(10) &
"WHERE (JOB_NO.JOB_NO=50068)")


but now I want to replace the 50068 above with a cell reference to the value
in cell A1.

I've tried and tried and can't get this to work.

Any help would be greatly appreciated.

Thanks.




Charles Maxson

Can't get this syntax correct, please help.
 
Sharlene,

I am not sure exactly what you are asking but I tried this line and it works
as per your spec (as best I can guess :-o)

MsgBox "SELECT JOB_NO.CUSTCODE, JOB_NO.JOB_NO" & Chr(13) & "" & Chr(10) &
"FROM `K:\DATA\DBDATA\JOBDATA`\JOB_NO.DBF JOB_NO" & Chr(13) & "" & Chr(10) &
"WHERE (JOB_NO.JOB_NO=" & Range("A1") & ")"


--
Charles
www.officezealot.com


"Sharlene England" wrote in message
...
I want to have the user type into cell A1 then the query will get the
correct information.

The following works:
"SELECT JOB_NO.CUSTCODE, JOB_NO.JOB_NO" & Chr(13) & "" & Chr(10) & "FROM
`K:\DATA\DBDATA\JOBDATA`\JOB_NO.DBF JOB_NO" & Chr(13) & "" & Chr(10) &
"WHERE (JOB_NO.JOB_NO=50068)")


but now I want to replace the 50068 above with a cell reference to the

value
in cell A1.

I've tried and tried and can't get this to work.

Any help would be greatly appreciated.

Thanks.






Tom Ogilvy

Can't get this syntax correct, please help.
 
"SELECT JOB_NO.CUSTCODE, JOB_NO.JOB_NO" & Chr(13) & "" & Chr(10) & "FROM
`K:\DATA\DBDATA\JOBDATA`\JOB_NO.DBF JOB_NO" & Chr(13) & "" & Chr(10) &
"WHERE (JOB_NO.JOB_NO=" & Worksheets("Sheet1").Range("A1").Value & ")"

--
Regards,
Tom Ogilvy

"Sharlene England" wrote in message
...
I want to have the user type into cell A1 then the query will get the
correct information.

The following works:
"SELECT JOB_NO.CUSTCODE, JOB_NO.JOB_NO" & Chr(13) & "" & Chr(10) & "FROM
`K:\DATA\DBDATA\JOBDATA`\JOB_NO.DBF JOB_NO" & Chr(13) & "" & Chr(10) &
"WHERE (JOB_NO.JOB_NO=50068)")


but now I want to replace the 50068 above with a cell reference to the

value
in cell A1.

I've tried and tried and can't get this to work.

Any help would be greatly appreciated.

Thanks.






Harald Staff

Can't get this syntax correct, please help.
 
"WHERE (JOB_NO.JOB_NO=" & Range("A1").Value & ")")

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Sharlene England" wrote in message
...
I want to have the user type into cell A1 then the query will get the
correct information.

The following works:
"SELECT JOB_NO.CUSTCODE, JOB_NO.JOB_NO" & Chr(13) & "" & Chr(10) & "FROM
`K:\DATA\DBDATA\JOBDATA`\JOB_NO.DBF JOB_NO" & Chr(13) & "" & Chr(10) &
"WHERE (JOB_NO.JOB_NO=50068)")


but now I want to replace the 50068 above with a cell reference to the value
in cell A1.

I've tried and tried and can't get this to work.

Any help would be greatly appreciated.

Thanks.






Sharlene England

Can't get this syntax correct, please help.
 
Thank you so much for the assistance.





All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com