Find via code

J

John

Hi

In form view, find command (Ctrl-F) is available to search records by a
field value. How can I do this find via code i.e. search for a record for a
given value in a field?

Thanks

Regards
 
V

Van T. Dinh

The general method is to use FindFirst Method of the (DAO) Recordset Object.
similarly, you can use ADO rather than DAO.

If you only wants a Field value of a Record whose value in another Field
matches some given value, you can use DLookUp() function also.

Check Access VB Help on Recordset, FindFirst, DLookUp (which is included in
Domain Aggregate Functions).

HTH
Van T. Dinh
MVP (Access)
 
Top