FindRecord Method

FindRecord Method

See Also         Example         Applies To

The FindRecord method carries out the FindRecord action in Visual Basic. For more information on how the action and its arguments work, see the action topic.

Syntax

DoCmd.FindRecord findwhat[, match][, matchcase][, search][, searchasformatted][, onlycurrentfield][, findfirst]

The FindRecord method has the following arguments.

Argument Description
findwhat An expression that evaluates to text, a number, or a date. The expression contains the data to search for.
match One of the following intrinsic constants:
  acAnywhere
acEntire (default)
acStart
  If you leave this argument blank, the default constant (acEntire) is assumed.
matchcase Use True (–1) for a case-sensitive search and False (0) for a search that's not case-sensitive. If you leave this argument blank, the default (False) is assumed.
search One of the following intrinsic constants:
  acDown
acSearchAll (default)
acUp
  If you leave this argument blank, the default constant (acSearchAll) is assumed.
searchasformatted Use True to search for data as it's formatted and False to search for data as it's stored in the database. If you leave this argument blank, the default (False) is assumed.
onlycurrentfield One of the following intrinsic constants:
  acAll
acCurrent (default)
  If you leave this argument blank, the default constant (acCurrent) is assumed.
findfirst Use True to start the search at the first record. Use False to start the search at the record following the current record. If you leave this argument blank, the default (True) is assumed.

Remarks

You can leave an optional argument blank in the middle of the syntax, but you must include the argument's comma. If you leave one or more trailing arguments blank, don't use a comma following the last argument you specify.