Solved

adodc1

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

829 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