Ms Access Runtime Error 2424
help? Post your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. Run-time error 2424 is driving me mad P: n/a Jim Devenish The current event of a continuous form is: Private Sub Form_Current() If IsNull(me.QuoteNumber) Then Me.quoteLetterButton.Caption = "Create quote letter" Else Me.quoteLetterButton.Caption = "View quote letter" End if End sub This works fine. The form has a bound control QuoteNumber with its control source as QuoteNumber. This is a text field. However I wish to extend this and disable another button if the QuoteNumber has a particular value: Private Sub Form_Current() If IsNull(me.QuoteNumber) Then Me.quoteLetterButton.Caption = "Create quote letter" Else If Me.QuoteNumber = "Regret" Then Me.RegretButton.Enabled = false Else Me.quoteLetterButton.Caption = "View quote letter" End if End if End sub As soon as I do this I get: Run-time error 2424 The expression you entered has a field, control, property name that Microsoft Access can't find. So I simplified it to: Private Sub Form_Current() Debug.print Me.QuoteNumber If IsNull(me.QuoteNumber) Then Me.quoteLetterButton.Caption = "Create quote letter" Else Me.quoteLetterButton.Caption = "View quote letter" End if End sub but this gives the same error. In the working version at the top I can step through with the debugger and see that Me.QuoteNumber has correct values, either null or some text but as soon as I try to use the value of the control/field in some other way things go pear shaped. Why is it that when I try to do anything else with it, I get an error? I have replaced the . by !, decompiled, compacted and even deleted the form and imported a fresh copy from another database but to no avail. I must have done something similar a thousand times without problem but something odd seems to be happening here. Any guesses would be welcome. Jim Oct 14 '06 #1 Post Reply Share this Question 3 Replies P: n/a Gord >I can step through with the debugger and see that Me.QuoteNumber has >correct values, either null or some text but as soon as I try to usethe value of the control/field in some other way things go pearshaped.Why is it that when I try to do anything else with it, I get anerror? Sometimes things can get confusing to Access when... 1. The developer relies on the default property of an object. In some contexts Access can get annoyed if you r
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 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 Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Run-time error '2424': The expression you entered has a field, control, or property name that Microsoft Access can't find Want to Advertise Here? Solved Run-time error '2424': The expression you entered has a field, control, or property name that Microsoft Access can't https://bytes.com/topic/access/answers/549431-run-time-error-2424-driving-me-mad find Posted on 2016-01-26 MS Access 1 Verified Solution 5 Comments 88 Views Last Modified: 2016-01-27 Thank you for looking at my question, I have a report in Access that I would like to have different background colours for each line depending upon the value of a control on that line. I wrote this as the On Open event: Private Sub Report_Open(Cancel As Integer) If Me.txtInstrFlag.Value = https://www.experts-exchange.com/questions/28921005/Run-time-error-'2424'-The-expression-you-entered-has-a-field-control-or-property-name-that-Microsoft-Access-can't-find.html "R" Then Me.Detail.BackColor = RGB(143, 188, 139) End If' End Sub txtInstrFlag is the name of the control that holds the value InstrumentFlag and is spelt correctly. If anybody can tell me where I'm going awry I would be most grateful 0 Question by:Crxfrd Facebook Twitter LinkedIn Google LVL 47 Active today Best Solution byDale Fye (Access MVP) instead of the report open event, use the Detail sections Paint event. During the Report Open event, the data has not been loaded yet. Then you should be able to use your original code: If Go to Solution 5 Comments LVL 47 Overall: Level 47 MS Access 13 Message Active today Expert Comment by:Rgonzo19712016-01-26 Hi, pls try If Me.txtInstrFlag.Text = "R" Then Select all Open in new window Regards 0 Message Author Comment by:Crxfrd2016-01-26 RGonzo1971, Changes the error to r/t error 2185 'You can't reference a property or method for a control unless the control has the focus' 0 LVL 47 Overall: Level 47 MS Access 46 Message Active today Accepted Solution by:Dale Fye (Access MVP)2016-01-27 instead of the report open event, use the Detail sections Paint event. During the Report Open event, the data has not been
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 19:27:56 GMT by s_wx1206 (squid/3.5.20)
Custom Search UtterAccess Forums>Microsoft® Access>Access Forms Run Time Error 2424 - Can't Find Control Forum HomeSearchHelpUA Messages|-- UtterAccess.com 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 + Relationships|-- Access Queries|-- Access Forms|-- Access Reports|-- Access Macros|-- Access Modules|-- Access Date + Time|-- Access Errors + Error Handling|-- Access Built-in Functions|-- 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 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 borissView Member Profile Mar 5 2008, 08:14 AM Post#1Posts: 211Joined: 25-September 02From: St Petersburg, FLAI am trying to utilize an Audit Trail to keep track of changes in my database. It works fine on a single form, but when I try to run it on a tab form I get Run Time Error 2424. Is this because of the Tabs? Here is the code:Private Sub Form_BeforeUpdate(Cancel As Integer)On Err GoTo TryNextC Dim MyForm As Form Dim ctl As Control Dim strUser As String Set MyForm = Screen.ActiveForm strUser = fOSUse