Ms Access Error 2108
help? Post your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. Can setfocus on a field error 2108 P: n/a SDL The code below says error 2108 must save field before setfocus? All I want to do is check out the input field and if in error set the cursor back on it after the MsgBox displays. In this case I read the file and didn't find it. If INVOICE_NBR1 = 0 Then MsgBox "INVOICE NUMBER is not on file. Re-enter or enter NAME or PHONE.",vbOKOnly Me.INV_NBR.SetFocus Any help would be great thanks. Jul 16 '06 #1 Post Reply Share this Question 1 Reply P: n/a Rick Brandt SDL wrote: The code below says error 2108 must save field before setfocus? All I want to do is check out the input field and if in error set the cursor back on it after the MsgBox displays. In this case I read the file and didn't find it. If INVOICE_NBR1 = 0 Then MsgBox "INVOICE NUMBER is not on file. Re-enter or enter NAME or PHONE.",vbOKOnly Me.INV_NBR.SetFocus Any help would be great thanks. Use BeforeUpdate for your validation code and just set Cancel=True if it fails. The control will never lose focus so resetting it is not required. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com Jul 16 '06 #2 This discussion thread is closed Start new discussion Replies have been disabled for this discussion. Similar topics SetFocus does not work in Access form Run Time Error 2110: cant move the SetFocus control SetFocus Issue In Access, how to use SetFocus within the LostFocus procedure (for same control) ACCESS combo box field how can i use setfocus with in the lostfocuse property SetFocus from tab page to main form Problem with SetFocus socket error asp.net setfocus after validation not working Browse more Microsoft Access / VBA Questions on Bytes Question stats viewed: 5730 replies: 1 date asked: Jul 16 '06 Follow this discussion BYTES.COM © 2016 Formerly "TheScripts.com" from 2005-2008 About Bytes | Advertise on Bytes | Contact Us Sitemap | Microsoft Access / VBA Answers Sitemap | Microsoft Access / VBA Insights Sitemap Follow us to get the Latest Bytes Updates
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 21:16:38 GMT by s_wx1126 (squid/3.5.20)
the Subject box. Below is my code: Private Sub Salary_BeforeUpdate(Cancel As Integer) 'Verify the Bonus Quota field value is 40 and if so Salary must be less than or equal to 30,000 If BonusQuota = 40 Then If Salary > 30000 Then http://www.pcreview.co.uk/threads/run-time-error-2108.2461445/ DoCmd.CancelEvent MsgBox "If Bonus Quota is 40, Salary must be LE 30,000" Me.Undo Salary.SetFocus End If http://www.utteraccess.com/forum/setfocus-issue-runtime-er-t1946367.html End If End Sub The error message reads: You must save the field B4 you execute the GoToControl action, the GoToControl method, or the SetFocus method. What is wrong? Thank You Hungry, Mar 25, 2006 #1 Advertisements TC Guest You can't change the focus from within the beforeupdate event. And you are also assuming that the /other/ field is the one that is wrong. Perhaps it ms access isn't - perhaps /this/ field is the one that is wrong! If you got your current scheme to work, it would move the cursor to the wrong field, 50% of the time. Here's what I'd do. Make the message /nonfatal/. (That is, make the message a warning only. Remove the cancelevent, undo & setfocus.) Then the user can navigate freely back & forth between the fields, to get the values corresponding. Then, do the check again, in the BeforeUpdate event of the /form/. ms access error If the two values do not correspond, display a message and then just say: Cancel=True That will stop the form from continuing. The user will have to move the cursor back to whatever field that /he/ decides is wrong, & fix the value. HTH, TC (MVP Access) http://tc2.atspace.com TC, Mar 25, 2006 #2 Advertisements Show Ignored Content Want to reply to this thread or ask your own question? It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum. Sign Up Now! Similar Threads run-time error'-2147217900(8004e14)': syntax error in FROM clause Guest, Jan 27, 2005, in forum: Microsoft Access VBA Modules Replies: 0 Views: 652 Guest Jan 27, 2005 run-time error'-2147217900(8004e14)': syntax error in FROM clause Guest, Jan 27, 2005, in forum: Microsoft Access VBA Modules Replies: 3 Views: 4,468 Guest May 23, 2006 Run Time Error 3048 - reserved error (-1104) Guest, Jul 23, 2005, in forum: Microsoft Access VBA Modules Replies: 1 Views: 738 Guest Jul 24, 2005 Can't Run Code using Run>Run Sub/User Form Guest, Aug 8, 2005, in forum: Microsoft Access VBA Modules Replies: 3 Views: 608 test1 Aug 16, 2005 Run-time error '2427 Error Message - Help!!!!!!!! Guest, Sep 13, 2006, in forum: Microsoft Access VBA Modules Replies: 4 Views: 826 Douglas J. Steele Sep 15, 2006 Trying to run update query in VBA, new error Run time 7874 BlueWo
Custom Search UtterAccess Forums>Microsoft® Access>Access Forms SetFocus issue runtime error 2108 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 NineIronView Member Profile Jun 9 2010, 10:53 AM Post#1Posts: 2,098Joined: 18-September 03From: MassachusettsI'm trying to set the focus onto a textbox when I click an option button in a frame. I get the Runtime error 2108, You must save the field before you execute the SetFocus Method.Any thoughts? Roger_CarlsonView Member Profile Jun 9 2010, 11:22 AM Post#2UtterAccess VIPPosts: 2,337Joined: 23-October 01From: West Michiganevent have you put the code behind? NineIronView Member Profile Jun 9 2010, 12:52 PM Post#3Posts: 2,098Joined: 18-September 03From: MassachusettsClick Roger_CarlsonView