borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (calculating total Values from datagrid)Next Topic (difference between filter,find and seek?) New Topic New Poll Post Reply
AndreaVB Forum : Database : VB Filter adodc control Solved Topic
Poster Message
honey0
Level: Graduate

Registered: 16-03-2006
Posts: 9

icon VB Filter adodc control

hey, trying to make a sort of filter of a data grid control on a VB form.

the data grid control is connected to a adoddc control, and theres a txt box on the form which i would like to be able to put a number and the datagrid return records where that field is equal.

there is also a standard data control on the form which is connected to a table that also contains the value which i would like to filter. is there a way to use this data control to get the value for the adodc filter. or how would i make a filter where i can enter a value into a text box and use that as filter critera.

SELECT Customer.[First Name], Customer.Surname, Customer.Telephone, Customer.[Customer ID], Items.[Order Number], Items.[Item ID], Jewellery.Name, Jewellery.Descrpition, Jewellery.Location
FROM Jewellery INNER JOIN (Customer INNER JOIN Items ON Customer.[Customer ID] = Items.[Customer ID]) ON Jewellery.[Item ID] = Items.[Item ID];

this is my current adodc setup and i would like to filter for customer id

16-03-2006 at 07:44 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: VB Filter adodc control

Use filter property

adodc1.recordset.filter="[customer id]=" & clng(filtervalue)


____________________________
If you find the answer helpful, please mark this topic as solved.

16-03-2006 at 08:12 PM
View Profile Send Email to User Show All Posts | Quote Reply
honey0
Level: Graduate

Registered: 16-03-2006
Posts: 9
icon Re: VB Filter adodc control

thanks for the reply, do i place adodc1.recordset.filter="[customer id]=" & clng(filtervalue) on a button

the  & clng(filtervalue) referes to ?

i jus gave it a try by putting this filter on the text box that i want the filter and it returns no values, and makes the adodc1 control inaactive. am i doing sumthing wrong, this seems like a perfect solutio if i can get it to work

[Edited by honey0 on 16-03-2006 at 08:21 PM GMT]

also tried Adodc1.Recordset.filter = "[customer id]=" & CLng(Text5.Text) on form load but get type miss match error

[Edited by honey0 on 16-03-2006 at 08:31 PM GMT]

thank you. after playinng about loading it as a variable i got it to work perfect and its so simple i was trying such complex sql statements.

[Edited by honey0 on 16-03-2006 at 08:36 PM GMT]

16-03-2006 at 08:15 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: VB Filter adodc control

At least you got better at SQL! Btw, if you find that your problem is solved, mark this topic...

____________________________
If you find the answer helpful, please mark this topic as solved.

16-03-2006 at 09:11 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : VB Filter adodc control Solved Topic
Previous Topic (calculating total Values from datagrid)Next Topic (difference between filter,find and seek?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder