Solved

Findrecord message if no record found

Posted on 2011-03-01
4
591 Views
Last Modified: 2012-06-27
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
Comment
Question by:gedwardnelson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35014093
is the form bound to the table or query?
what does Me!txtRecord contain? is this an input from the keyboard?
0
 

Author Comment

by:gedwardnelson
ID: 35014170
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
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 35014228

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
 

Author Closing Comment

by:gedwardnelson
ID: 35014298
Thanks again Cap. Worked perfectly!

George
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question