Ms Access Runtime Error 2162
Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rate Thread Display Modes 09-16-2014, 09:09 AM #1 fat controller Slightly round the bend.. Join Date: Apr 2011 Posts: 672 Thanks: 347 Thanked 5 Times in 5 Posts Runtime error 2162 - intermittent I am really confused now - I have some code which works perfectly well for the vast majority of the time, however once in a while it will throw its toys out of the pram and give me an error message 'Runtime Error 2162' and states that this is due to an error in the FindRecord Statement; when debugged, it highlights the line of code (below) which is the FindRecord Statement: Code: DoCmd.FindRecord EmpNo, acEntire, , acSearchAll, False, acCurrent Yet, I can see nothing wrong with this code? Surely if the code was duff, it wouldn't work at all? The problem seems more likely to happen if the database has not long been opened, if that makes any sort of difference? I'd be grateful for any help that can be given, as I am not keen on releasing the database into use knowing that its a bit buggy. fat controller View Public Profile Find More Posts by fat controller 09-16-2014, 10:06 AM #2 fat controller Slightly round the bend.. Join Date: Apr 2011 Posts: 672 Thanks: 347 Thanked 5 Times in 5 Posts Re: Runtime error 2162 - intermittent I think I have solved it by adding a 1 second pause to the code just as it starts (and well before it gets to the FindRecord command) - although I have no idea why this would make a difference? EDIT - nah, it didn't. Logged out for a couple of minutes and logged back in and the problem is still there. So frustrating, not least because it is not happening all the time. Last edited by fat controller; 09-16-2014 at 10:12 AM. fat controller View Public Profile Find More Posts by fat controller 09-16-2014, 10:25 AM #3 MarkK Super Moderator
Technology and Trends Enterprise Architecture and EAI ERP Hardware IT Management and Strategy Java Knowledge Management Linux Networking Oracle PeopleSoft Project and Portfolio Management SAP SCM Security Siebel Storage UNIX Visual Basic Web Design and Development Windows < Back CHOOSE A DISCUSSION GROUP Research Directory TOPICS Database Hardware Networking SAP Security Web Design MEMBERS Paul_Pedant DACREE MarkDeVries MacProTX VoIP_News Inside-ERP I_am_the_dragon Inside-CRM maxwellarnold Michael Meyers-Jouan TerryCurran Chris_Day Andrew.S.Baker Ramnath.Awate JoeTorre Locutus Craig Borysowich Dennis Stevenson mircea_luca Richard DukeGanote iudithm Clinton Jones bracke Nikki Klein AbhaiTripathi Iqbalyk jakarman Adrian_Grigoriu knowscognosdoi COMPANIES eFax Corporate Avaya Trend Micro Incorporated CloudLock View All http://www.access-programmers.co.uk/forums/showthread.php?t=269261 Topics View All Members View All Companies Toolbox for IT Topics Database Groups Ask a New Question Microsoft Access The Microsoft Access group is for the discussion of issues that arise during the implementation, configuration, administration, or daily use of MS Access. Home | Invite Peers | More Database Groups Your account is ready. You're now being signed in. Solve problems - It's Free Create your account in http://database.ittoolbox.com/groups/technical-functional/access-l/findrecord-gives-runtime-error-2162-5355030 seconds E-mail address is taken If this is your account,sign in here Email address Username Between 5 and 30 characters. No spaces please The Profile Name is already in use Password Notify me of new activity in this group: Real Time Daily Never Keep me informed of the latest: White Papers Newsletter Jobs By clicking "Join Now", you agree to Toolbox for Technology terms of use, and have read and understand our privacy policy. Findrecord Gives Runtime Error 2162 Guest_PK asked Oct 31, 2013 | Replies (2) I am getting run time error 2162 "A macro set to one of the current field properties failed because of an error in a FindRecord action argument" when the control transfers from Search Form to View-Update Form. What I am trying to do is, based on the search result in Search Form, I'm trying to populate details on the View-Update Form. On the View-Update form, I'm trying to populate data from a query where I'm linking 2 tables to find the details. So my Row Source is the name of the query. Below is the code that I have on the Search Form: Private Sub List9_Click() SearchID = List9 DoCmd.Close acForm, "View-Update" DoCmd.OpenForm "View-Upda
Custom Search UtterAccess Forums>Microsoft® Access>Access Modules Runtime error in VBA only when using breakpoints Forum HomeSearchHelpUA Messages|-- UtterAccess.com http://www.utteraccess.com/forum/Runtime-error-VBA-bre-t365359.html NewsAccess Knowledge Center|-- Access Code Archive|-- Access Knowledgebase / FAQ|-- Access TutorialsMicrosoft® Access|-- Local Access User Groups (AUGs)|-- Interface Design|-- Access Q and A|-- Access Tables http://www.verycomputer.com/205_a924df26118681e6_1.htm + Relationships|-- Access Queries|-- Access Forms|-- Access Reports|-- Access Macros|-- Access Modules|-- Access Date + Time|-- Access Errors + Error Handling|-- Access Built-in Functions|-- Access ms access Searching + Data Mining|-- Access Records|-- Access Security|-- Access Automation|-- Access Database Container|-- Tool bars, Menu bars + Ribbon|-- Access Services (Web Databases)|-- Access Data Access Pages (Deprecated)|-- Access Data Projects - ADP|-- Access Runtime, Packaging & DeploymentAnd More...|-- Microsoft SQL Server|-- SQL Server Reporting Services|-- Microsoft SharePoint|-- Microsoft Internet Explorer|-- Visual ms access runtime Basic 6 and Earlier|-- Visual Basic 2003 and Later|-- ASP and VBScript|-- Web Development|-- PHP, Perl, MySQL and Postgres|-- Other Database Engines|-- BI Tools and Applications|-- JAVA and C#|-- GraphicsMicrosoft® Office|-- Microsoft Excel|-- Microsoft Excel FAQs|-- Microsoft Word|-- Microsoft Outlook|-- Microsoft PowerPoint|-- Microsoft FrontPage/Exp. Web|-- Other Microsoft ProductsPC|-- Network Issues|-- Q & A - Hardware|-- Q & A - Software|-- Q & A - Other PC|-- Virus + Security DiscussionUtterAccess Odds and Ends|-- General Chat|-- Q & A - UtterAccess.com Forums|-- Q & A - Access Wiki Options parryView Member Profile Jan 13 2004, 05:35 PM Post#1Posts: 125Joined: 20-January 03From: Wellington, NZHi could someone please explain why you sometimes get runtime errors if there is a breakpoint on certain statements in VBA?Is an example the following line bombs if there is a breakpoint on this line, but not if there is a breakpoint before or after this line. The error
a FindRecord action argument Can anyone explain to me what this means, I have look at the help file and follow their example but cannot figure it out. I also tried different ways of the findwhat argument but no success Private Sub Combo9_AfterUpdate() Dim strCity As String strCity = Me.Combo9.Value DoCmd.FindRecord strCity, acEntire, False, acSearchAll, , , True (other tries) DoCmd.FindRecord "& strCity &",....... DoCmd.FindRecord "' & strCity & '",....... DoCmd.FindRecord Me.Combo9,....... End Sub Thanks Alain Top 1. Problems with Error 2162 Dear All, I have a form with a popup. I have coded a piece of code which works on double clicking the popup. The code was closed in a function called LocateRecord. The idea of the code is to find a record from another form, thus revealing more information after the option selecting from the popup. The problem is this. The code works fine from one form. When copied to another similar form I am received this message "A macro set to one of the current field's properties failed because of an error in a FindRecord action argument" - Error 2162. Below is the Access 2000 code which should do the job. The error is received when the DoCmd.FindRecord line is invoked. Any help or suggestion is appreciated Duncan Dimech MMA IT The code snippet >>>>>>>> Function LocateRecord(FocusField As Control, PrimarySearchFieldName As Control, PrimarySearchFieldValue As String, FormToClose As Form, FormClose As Boolean, Optional SecondarySearchFieldName As Control = Nothing, Optional SecondarySearchFieldValue As String = "") On Error GoTo Err_LocateRecord Dim fieldvisible 'this routine is used to find a particular record stored within a table If FormClose = True Then DoCmd.Close acForm, FormToClose.Name DoCmd.ShowAllRecords End If 'this part will check if the field used for