Solved

adodc1

Posted on 2009-07-12
5
291 Views
Last Modified: 2013-12-26
How to correct my code in ado RecordSource?


select s.proname as [Item Description], s.Procode as[Item Code], s.Quantity , um as [UOM], s.sellingprice as [Price 1],s.vndrid as [Supplier],pricea as [Price 2], priceb as [Price 3]  from stock s inner join typediscount t on s.procode=t.proid order by  s.vndrid='" text1.text & "'"

Open in new window

0
Comment
Question by:Whing Dela Cruz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 6

Assisted Solution

by:microbolt
microbolt earned 500 total points
ID: 24835630
You missing and & near text1.text.  Correct code is below:
select s.proname as [Item Description], s.Procode as[Item Code], s.Quantity , um as [UOM], s.sellingprice as [Price 1],s.vndrid as [Supplier],pricea as [Price 2], priceb as [Price 3]  from stock s inner join typediscount t on s.procode=t.proid order by  s.vndrid='" & text1.text & "'"

Open in new window

0
 

Author Comment

by:Whing Dela Cruz
ID: 24835665
Hi! I tried but an error message says " Incorrect syntax near '=',
0
 

Author Comment

by:Whing Dela Cruz
ID: 24835688
When i tried to run it to mssqlserver Query as this

 select s.proname
 as [Item Description], s.Procode as[Item Code], s.Quantity , um
 as [UOM], s.sellingprice
 as [Price 1],s.vndrid
 as [Supplier],pricea
 as [Price 2], priceb
 as [Price 3]  
 from stock s
 inner join typediscount t
 on s.procode=t.proid
 order by  s.vndrid = & "text1.text" & ""
then an error says
 Server: Msg 170, Level 15, State 1, Line 11
Line 11: Incorrect syntax near '='.
Can you correct this error?
Thanks!
0
 
LVL 6

Accepted Solution

by:
microbolt earned 500 total points
ID: 24835690
You have the full error message that you can post here?

Something else that is order by is expecting and column name not an assignment.  What are you trying to accomplish by:

      order by  s.vndrid='" & text1.text & "'"

if your wanting to order by vndrid then it should only be like:

      order by  s.vndrid"
0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 31602618
Hi! You had given me correct answered! Thanks to you and more power..
Can you extend your help to my other posted question? I hope you will...
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question