Solved

adodc1 - Part 2

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

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

Suggested Solutions

Title # Comments Views Activity
Controlling which port to download from 4 71
VBA loop through headers using value 3 57
Added a column screws up code 5 50
Problem to With line 4 43
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

867 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

23 Experts available now in Live!

Get 1:1 Help Now