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
Solved

adodc1 - Part 2

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

828 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