Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 609
  • Last Modified:

Findrecord message if no record found

I am using the findrecord function and I need to have a message popup if the record isn't found.

The code I am using is:

DoCmd.GoToControl "ID"
DoCmd.FindRecord Me!txtRecord, , True, , True
0
gedwardnelson
Asked:
gedwardnelson
  • 2
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
is the form bound to the table or query?
what does Me!txtRecord contain? is this an input from the keyboard?
0
 
gedwardnelsonAuthor Commented:
Hi Capricorn1

Yes it's a bound form. Me!txtrecord is an unbound text box where the record number is entered from the keyboard.

ID is an autonumber field of the bound form.

If the specific record number doesn't exist (it's been deleted for example, or the record number being looked for is greater than exists) a message box will appear notifying the user the record doesn't exist.

Thanks,
George
0
 
Rey Obrero (Capricorn1)Commented:

try this codes

with me.recordsetclone

       .findfirst "[ID]=" & me.txtrecord
        if not .nomatch then
             me.bookmark=.bookmark
             else
              msgbox "record not found"
        end if

end with
0
 
gedwardnelsonAuthor Commented:
Thanks again Cap. Worked perfectly!

George
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now