Ms Access Error 3022 Trapping
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 Trap the 3022 error thread702-1545986 Forum Search FAQs Links MVPs Trap the 3022 error Trap the 3022 error annie52 (TechnicalUser) (OP) 30 Apr 09 16:03 I can't figure out how to trap the 3022 error that's generated when I enter a duplicate record and then try to leave the record via the navigation buttons.None of the form's events seem to catch this error. RE: Trap the 3022 error kjv1611 (IS/IT - Management) 30 Apr 09 16:08 How have you tried?Are you trying to capture the code in VBA with an error-handler routine? --"If to err is human, then I must be some kind of human!" -Me RE: Trap the 3022 error annie52 (TechnicalUser) (OP) 30 Apr 09 16:27 Hi, kjv1611.I'm not sure I know what you mean by "an error-handler routine".Here's what I have in the form's OnError event:On Error GoTo Err_Form_ErrorExit_Form_Error:Exit SubErr_Form_Error:If Err.Number = 3022 ThenMsgBox "That requisition number already exists."Response = acDataErrContinueElseMsgBox "Error #" & Err.Number & "" & Err.DescriptionEnd IfResume Exit_Form_ErrorIt doesn't trap this error though
to the pre-existing record If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 8 of 8 Thread: Trapping error 3022 in order to automatically navigate to the pre-existing record Tweet Thread Tools Show Printable Version Subscribe to this http://www.tek-tips.com/viewthread.cfm?qid=1545986 Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 07-21-08,15:07 #1 hunterw View Profile View Forum Posts Registered User Join Date Jun 2008 Posts 22 Unanswered: Trapping error 3022 in order to automatically navigate to the pre-existing record Howdy all, I've hit a snag. I have a surrogate primary key - http://www.dbforums.com/showthread.php?1632390-Trapping-error-3022-in-order-to-automatically-navigate-to-the-pre-existing-record a unique ID that is input by the user. Frequently people will enter an ID in order to fill out a different part of my form, and they will have no idea if the record exists yet or not. I need to trap error 3022 and automatically navigate to the pre-existing record. How can I go about doing this? Thanks in advance! Reply With Quote 07-21-08,16:30 #2 gvee View Profile View Forum Posts Visit Homepage www.gvee.co.uk Join Date Jan 2007 Location UK Posts 11,422 Provided Answers: 10 Code: On Error GoTo ErrorHandler
Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools http://www.access-programmers.co.uk/forums/showthread.php?t=91116 Rate Thread Display Modes 07-31-2005, 10:42 AM #1 aidan Registered User Join Date: May 2005 Posts: 34 Thanks: 0 Thanked 0 Times in 0 Posts Trapping error 3022 My table has an auto generated key as a string. So on the offchance that two clients are trying to autogenerate a key at exactly the same time, I'm trying to trap the 3022 ms access error raised when a duplicate key is entered so that I can repeat the operation with a goto. I'm raising the error with requery like this: Code: DoCmd.Save acForm, Me.Name 'next line triggers 3022 DoCmd.Requery After I realised that the normal handler wouldn't trap it I got the database from this thread: http://www.access-programmers.co.uk/...highlight=3022 But it doesn't seem to work for me: http://www.imagedump.com/index.cgi?pick=get&tp=288631 Anyone? ms access error aidan View Public Profile Find More Posts by aidan 07-31-2005, 12:50 PM #2 RuralGuy AWF VIP Join Date: Jul 2005 Location: @ 8300' in the Colorado Rockies Posts: 13,412 Thanks: 2 Thanked 250 Times in 242 Posts What event is this code located and do you have error trapping code in there? What makes you believe a normal handler will not trap this error? I do it all of the time. How about posting all of the code in this subroutine or function? __________________ (RG for short) aka Allan Bunch Previous MS Access MVP acXP, ac07, ac10, ac13 - WinXP Pro, Win7 Pro, Win10 Pro Please post back to this Forum so all may benefit. Teaching is not filling a bucket but lighting a fire. Last edited by RuralGuy; 07-31-2005 at 12:51 PM. Reason: Additional information in Red RuralGuy View Public Profile Find More Posts by RuralGuy 07-31-2005, 03:16 PM #3 aidan Registered User Join Date: May 2005 Posts: 34 Thanks: 0 Thanked 0 Times in 0 Posts It's just a button event: Code: Private Sub SaveChan