, , False, , True Thanks for your input. Greating, Pascal from the Netherland. Last edited by Passie; 08-10-2005 at 03:51 AM. 08-15-2005, 01:03 AM #2 Passie Guest Posts: n/a Problem solved. There was no record to be found, so the message is based on this. I thought it was a programming error. I used the code "On Error Resume Next" and my program runs OK. « Previous Thread | Next Thread » Thread Tools Show Printable Version Email this Page Mark this thread as unsolved Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Rate This Thread Excellent Good Average Bad Terrible Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Access World Access World News Site Suggestions Introduce Yourself The Watercooler Microsoft Access Discussion General Tables Queries Forms Reports Macros Modules & VBA Theory and practice of database design Access Web Microsoft Access Reference Access FAQs Code Repository Sample Databases Microsoft Access Tutorials Microsoft Access User Groups Apps and Windows SQL Server Crystal Reports Visual Basic VB.NET Word Excel Web Design and Development ASP and ASP.NET PHP & MySQL Windows Other Software Hardware Questions and Answers Non-Access Issues Politics & Current Events Debates Gaming Sports, Health & Fitness Gadgets Small Business Similar Threads Thread Thread Starter Forum Replies Last Post Run time versions and missAsk a Question Need help? Post your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. Runtime error 2137: You can't use find or replace now. P: 22 kickergirl I have created a form to allow users to add a new record and/or http://www.access-programmers.co.uk/forums/showthread.php?t=91716 search for an existing record based on SSN. If the SSN the user enters into SrchID_text is found, the form is populated and a message appears telling the user that the record exists and they can edit existing information or add new information. If the SSN is https://bytes.com/topic/access/answers/738741-runtime-error-2137-you-cant-use-find-replace-now not found, a new record is supposed to be created and a message appears telling the user that no match was found and they can begin entering data. My problem occurs when there are no records in the database. How do I get around this? Please see code below: Expand|Select|Wrap|Line Numbers PrivateSubSrchID_But_Click() DimstrStudentRefAsString DimstrSearchAsString 'CheckSrchID_textforNullvalueorNillEntryfirst. IfIsNull(Me![SrchID_Text])Or(Me![SrchID_Text])=""Then MsgBox"PleaseenteraSSNtosearchfor!",vbOKOnly,"InvalidSearchCriterion!" Me!SrchID_Text.SetFocus ExitSub EndIf '--------------------------------------------------------------- 'PerformsthesearchusingvalueenteredintoSrchID_text 'andevaluatesthisagainstvaluesinSSN DoCmd.ShowAllRecords DoCmd.GoToControl("SSN") DoCmd.FindRecordMe![SrchID_Text] SSN.SetFocus strStudentRef=SSN.Text SrchID_Text.SetFocus strSearch=SrchID_Text.Text 'Ifmatchingrecordfoundfillsindataand 'setsfocusonparticipant'sfirstnameand 'clearssearchcontrol IfstrStudentRef=strSearchThen MsgBox"MatchFoundFor:"&strSearch&vbCrLf&""&vbCrLf&"Pleaseeditoradddataasneeded.",,"ExistingRecordFound" F_Name.SetFocus SrchID_Text="" 'IfvaluenotfoundsetsSSNequaltosearchedSSNand 'informsusertobeginenteringdataandsetsfocuson 'F_Name Else MsgBox"MatchNotFoundFor:"&strSearch&vbCrLf&""&vbCrLf&"Pleasebeginenteringdataforthisnewparticipant.",_ ,"NewParticipant!" DoCmd.GoToRecord,,acNewRec SSN.SetFocus SSN.Text=strSearch LWIA_Combo.SetFocus EndIf EndSub Nov 19 '07 #1 Post Reply Share this Question 5 Replies Expert Mod 10K+ P: 12,110 Rabbit Me.Recordset.RecordCount will let you know if you have at least one record. Nov 19 '07 #2 reply P: 22 kick
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive https://www.experts-exchange.com/questions/22699237/run-time-error-'2137'.html Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers http://www.tek-tips.com/viewthread.cfm?qid=828746 Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > run-time error '2137' Want to Advertise Here? Solved run-time error '2137' Posted on 2007-07-16 MS Access ms access 3 Verified Solutions 15 Comments 1,603 Views Last Modified: 2013-11-28 I have a database that keeps track of tests that employees are required to take on a yearly basis. At the beginning of a new year, I save the previous years data so that it is still accessable and add a link to the previous years ms access error page for that purpose. The form has a command that activates the find control. When I go to activate the find control in the previous years data it get 'run time error 2137' message. The VBA code below works in all the forms except the one that access the most current previous years data. Private Sub cmdfind_Click() On Error GoTo Err_cmdfind_Click DoCmd.Maximize Me.txtName.SetFocus 'Screen.PreviousControl.SetFocus DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 Exit_cmdfind_Click: Exit Sub Err_cmdfind_Click: MsgBox Err.Description Resume Exit_cmdfind_Click End Sub The error occurs on the following line: DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 I'm pretty sure I'm not explaining this in a clear way, but if anyone could help with this error I would greatly appreciate it!! 0 Question by:Jeanniem Facebook Twitter LinkedIn Google LVL 119 Active today Best Solution byRey Obrero error 2137- generated for the following reasons You can't use Find or Replace now.@The fields are not searchable due to one of the following:
FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *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.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Microsoft: Access Forms Forum at Tek-Tips HomeForumsProgrammersDBMS PackagesMicrosoft: Access Forms Forum Can't figure out why it won't let me search the DB thread702-828746 Forum Search FAQs Links MVPs Can't figure out why it won't let me search the DB Can't figure out why it won't let me search the DB Brutus2600 (TechnicalUser) (OP) 26 Apr 04 13:26 I grabbed some VB code to use with a command button to search the database from a VB Access site and modified it to fit my database. However, when I try to search it gives me this error:Quote:Run-time error '2137':You can't use Find or Replace now.Then I can end it or debug it, and it says this is the line of code hanging it all up:CODEDoCmd.FindRecord Me!txtSearchSo two things: Any idea what the problem might be? And what is the 'Me!' I see in examples and stuff? Is it a variable I have to change to fit my database? I also saw this when Scriverb helped me in a previous topic:CODEMe![Exit].Enabled = FalseIf you need the entire code for the search button let me know. Thanks again! RE: Can't figure out why it won't let me search the DB missinglinq (Programmer) 26 Apr 04 14:01 M