Solved

adodc1 - Part 2

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

762 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

22 Experts available now in Live!

Get 1:1 Help Now