DoCmd Object.
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.
DoCmd.FindRecord findwhat [, match] [, matchcase] [, search] [, åsearchasformatted] [, onlycurrentfield] [, findfirst]
The FindRecord method uses 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 If you leave this argument blank, the default (acEntire) is assumed. |
matchcase |
Use True (-1) for a case-sensitive search and False (0) for a search that is not case-sensitive. If you leave this argument blank, the default (False) is assumed. |
search |
One of the following intrinsic constants: acUp If you leave this argument blank, the default (acSearchAll) is assumed. |
searchasformatted |
Use True to search for data as it is formatted and False to search for data as it is stored in the database. If you leave this argument blank, the default (False) is assumed. |
onlycurrentfield |
One of the following intrinsic constants: acCurrent If you leave this argument blank, the default (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. |
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.
DoCmd Object, FindRecord Method, FindRecord Action.
This example finds the first occurrence in the records of the name Smith in the current field. It doesn’t find occurrences of smith or Smithson.
DoCmd.FindRecord "Smith",, True,, True
See Int, Fix Functions.