Solved

adodc1 - Part 2

Posted on 2009-07-12
5
183 Views
Last Modified: 2013-12-26
Hi! the Code below was Corrected by "microbolt" Its already run  but I miss to mention him that I need to add something like instead of  order by  s.vndrid  I need to make order by  s.vndrid='" & "s100" & "'"
My purpose is I want only to come out those item under s100.
To microbolt
      I missed to mention you this question... Thanks!

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

Open in new window

0
Comment
Question by:Whing Dela Cruz
  • 3
5 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 24835879
Hello ERWIIN,

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
 WHERE   s.vndrid <'s100'
ORDER BY s.VndRId


Regards,

Aneesh
0
 

Author Comment

by:Whing Dela Cruz
ID: 24835985
Hi! I tried to change this  WHERE   s.vndrid <'s100'   to WHERE   s.vndrid ='s100'  and its working in sql Server query. In my application i change s100 to text1.text as code below. I put that code in RecordSource under adodc1 then it does'n work. I don't how to use it, can you extent your help  on how to activate it? its already working in sql query.. Thank


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 
 WHERE   s.vndrid ='TEXT1.TEXT'
ORDER BY s.VndRId

Open in new window

0
 

Author Comment

by:Whing Dela Cruz
ID: 24836148
Hi! Here' my final code that need to changed S100 to text1.text
Private Sub TDDrop_DropDownOpen()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=mydb;Data Source=Winpos"
Adodc1.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 WHERE s.vndrid ='s100'  ORDER BY s.VndRId"
Adodc1.Refresh
End Sub
The only problem here is to change 'S100' to text1.text  . Please Help! Thanks
0
 
LVL 22

Assisted Solution

by:danaseaman
danaseaman earned 250 total points
ID: 24836701
Adodc1.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 WHERE s.vndrid = " & Text1.Text  & " ORDER BY s.VndRId"
0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 31602631
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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