Solved

adodc1 - Part 2

Posted on 2009-07-12
5
175 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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 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…
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…

803 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