Solved

Using 'FindFirst' property of Data control

Posted on 2004-05-01
2
1,898 Views
Last Modified: 2013-11-25
I have 5 text boxes linked to fields in an Access database, the table being controlled by a Data control. I'm adding a search facility, and I'm not quite sure how to work the 'FindFirst' property. Syntax should be data.recordset.findfirst(criteria) - but I don't know how to format the criteria. How is it done? Thanks.
0
Comment
Question by:mi5
2 Comments
 
LVL 11

Assisted Solution

by:bingie
bingie earned 25 total points
ID: 10968481
The syntax is:

Data1.Recordset.FindFirst (field_name = "search_string")

Where filed_name is the name of the field you want to search and
search_string is the sting you want to search for.

It will find the first instance of the string.
0
 
LVL 1

Accepted Solution

by:
puneesh earned 25 total points
ID: 10976348
Consider a table named "Names" containing 2 fields, FirstName and SecondName. Now you want to search based upon FirstName. The code would be:

Dim strSearch as String

strSearch = "Your search Value here"
Data1.Recordset.FindFirst ("FirstName = '" & strSearch & "'")


The "Criteria" argument of FindFirst method is of "String" type. Therefore it need to be enclosed into double Quotes.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

747 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

13 Experts available now in Live!

Get 1:1 Help Now