×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

find record command "error 2162"

find record command "error 2162"

find record command "error 2162"

(OP)
Hallo I have a single form. I would like to put an unbound text field to use it as a search text box for the whole recordset. The user write something and then click a small "go" button. The code I put behind the button is this:

DoCmd.FindRecord [Txt_search], acAnywhere

but there is this runtime error 2162: a macro set to one of the current fields properties failed because of an error in a findrecord action argument.

Does someone know what's going on?
thanks

RE: find record command "error 2162"

karerda,

Try:

DoCmdFindRecord Me![Txt_search], acAnywhere.

HTH
Todd

RE: find record command "error 2162"

(OP)
Hallo Tcarpenter,
I tried:
 Me!txt_search
Me.txt_search
Me![txt_search]
 but none works...

RE: find record command "error 2162"

karerda,

Sorry, I'm afraid I don't use FindRecord enough to know the ins and outs, but I suspect your problem may have something to do with this blurb I found in the help file:

Quote:

However, note that if you use a command button to run a macro containing the FindRecord action, the first instance of the search criteria will be found repeatedly. This is because clicking the command button changes the focus from the field containing the matching value. The FindRecord action will then begin searching from the start of the record. The first instance of the search criteria will be found repeatedly in the same record. To avoid this problem, run the macro by using a technique that doesn't change the focus, such as a custom toolbar button or a key combination defined in an AutoKeys macro, or in the macro set the focus to the field containing the search criteria before you carry out the FindRecord action.

HTH
Todd

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close