Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Can't get this syntax correct, please help.

Thank you so much for the assistance.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct syntax for IF, Then in a macro Ken[_2_] Excel Worksheet Functions 5 June 21st 08 06:19 PM
Correct Syntax TeeSee Excel Discussion (Misc queries) 6 February 28th 08 01:36 AM
Correct VBA syntax Ken G. Excel Discussion (Misc queries) 3 December 7th 05 12:35 AM
ListBoxes - correct syntax Bob Phillips[_5_] Excel Programming 0 September 17th 03 02:02 PM
What is correct syntax for a CommandButton? Les[_4_] Excel Programming 1 August 4th 03 08:46 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"