Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 22nd, 2007, 01:06 PM
Registered User
Join Date: Apr 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search Dataset

Hi, I have been looking through the internet for some time now trying to find out how to search a dataset for records based on a user input textbox at runtime. Basically a query which updates the dataset automatically with the results on a button click with a given parameter being searchtxt.text.

Anyone got any suggestions for this, at least which direction to point me in? Any help will be most appreciated. Thanks

  #2 (permalink)  
Old April 22nd, 2007, 11:52 PM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts

You can use the Find method of the record set

RS.Find("FName='Bob'", , adSearchForward)

Find will allow wild card searches using like also

Hope you get what you wanted


  #3 (permalink)  
Old April 23rd, 2007, 10:45 AM
Registered User
Join Date: Apr 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Hi, thanks for the quick reply, Im pretty new to VB in general but entirely new in this subject. I understand the syntax of the code you listed as an example but Im not sure how to define a recordset or at least how to implement the code properly, Thanks

  #4 (permalink)  
Old April 23rd, 2007, 11:03 AM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

The VB help system has a lot of info on how to create and populate recordsets.
It is not hard, but there's a lot of code that you can already find at your fingertips...

Recordsets are objects, so you must delare them (Dim MyRecSet as . . .), intstatiate them (Set MyRecSet = New . . .) and open them (MyRecSet.Open("SELECT . . . ", . . . ).

The environment matters. From within Access the process is different than, say, within Word’s VBA, or within the VB Integrated Development Environment.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search button doesn't search Access DB cbones Visual Studio 2008 1 October 27th, 2008 07:36 PM
New text search doesn't preselect search string planoie Visual Studio 2005 0 July 23rd, 2007 06:47 AM
Fill(dataset) or dataset.load() salemkoten SQL Server 2005 1 November 2nd, 2006 11:04 PM
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.