Solved

adodc1

Posted on 2009-07-12
5
281 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now