Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 17974
Number of posts: 55343

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Recordset Filter Problem Posted by Kizzo on 25 Jun 2005 at 5:15 AM
Private Sub txtSearchBox_Change()
If txtPartN = "" Or txtSearchBox = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Exit Sub
End If
Adodc1.Recordset.Filter = txtPartN.Text & " Like '*" & txtSearchBox.Text & "*'"
End Sub
'What's wrong with this code? Pls help me..
Report
Re: Recordset Filter Problem Posted by seancampbell on 25 Jun 2005 at 6:47 AM
: Private Sub txtSearchBox_Change()
: If txtPartN = "" Or txtSearchBox = "" Then
: Adodc1.Recordset.Filter = ""
: Adodc1.Refresh
: Exit Sub
: End If
: Adodc1.Recordset.Filter = txtPartN.Text & " Like '*" & txtSearchBox.Text & "*'"
: End Sub
: 'What's wrong with this code? Pls help me..
:

What exactly are you doing?

You don't have to put a full SQL statement in for filter? (I don't use datcontrols much any more)
Report
How to use ComboBox? Posted by Kizzo on 26 Jun 2005 at 11:50 PM
How to use ComboBox as lookup box for a basic data entry form.
That is, binding a ComboBox to database lookup table using ADO control.

I have 2 ADO controls on the form:

1. ComboBox to specify field in the Table Products.
2. SearchBox for searching/filtering through the Recordset based on ComboBox.

I have Items.mdb with Table Products which fields are Part No and Serial No. And I want to bind ComboBox to specify field in the Table Products.

Pls help..
Report
Re: Recordset Filter Problem Posted by Flakes on 27 Jun 2005 at 8:39 PM
: Private Sub txtSearchBox_Change()
: If txtPartN = "" Or txtSearchBox = "" Then
: Adodc1.Recordset.Filter = ""
: Adodc1.Refresh
: Exit Sub
: End If
: Adodc1.Recordset.Filter = txtPartN.Text & " Like '*" & txtSearchBox.Text & "*'"
: End Sub
: 'What's wrong with this code? Pls help me..
:


try using % instead of * as the wildcard :


Adodc1.Recordset.Filter = txtPartN.Text & " Like '%" & txtSearchBox.Text & "%'"





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.