I retract my MS reference--you are TOO good for them!!I did have one more question: when I created the table with the primary key being AutoNumber, and then put in some The Change event for this combobox sets the focus in a text box to add the number of hours. You can retrive the new ID by immediately running (after the update): Dim rst As ADODB.Recordset Dim intNewAutoNumber As Integer Set rst = New ADODB.Recordset rst.Open "SELECT @@IDENTITY", CurrentProject.Connection intNewAutoNumber = If/when I try add another record(s) it gives me run-time error 3022 (no duplicates allowed). https://support.microsoft.com/en-us/kb/966136
Integer function which takes every value infinitely often Using Elemental Attunement to destroy a castle Displaying nmap result gradually as results are found What are the implications of the curse of Now you can let Access worry about generating a unique PK, and you just have to worry about generating your own unique TaskNo.......... It works in every situation except when the user clicks the close button. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.
The problem I found was when the last record added is a duplicate. Regards, Michael Michael.K View Public Profile Find More Posts by Michael.K
Site Message (Message will auto close in 2 seconds)Welcome to UtterAccess! There must be an index or a relation that you believe is innocuous but is actually the cause of the error. Strangely enough, using the close box on the form with duplicate records does trigger my custom error message. https://bytes.com/topic/access/answers/562625-custom-error-message-runtime-error-3022-a Password Reminder Password Register Register | FAQ | Members List | Calendar | Today's Posts | Search Access Discussion of Microsoft Access database design and programming.
Does that make sense? rst!UploadedBy=GUsername'Storestheuserwhouploadedthefile. However, it is missing the 74 records "due to key violations". #2 (permalink) July 31st, 2008, 11:17 AM DavidWE Registered User Join Date: Aug 2006 Location: , , After the combobox (cboGroupID) value is changed this changes the GroupID field in the underlying table which is part of a multiple primary key along with fields for the month and
Are you suggesting that I make BOTH (I'm not shouting) of these changes or one or the other of them? Thanks for the info, I shall have to do some more reading! Change the datatype of the primary key (to Number)? Therefore, I recommend the following: In Access, with all tables closed, click the "Database Tools" tab on the ribbon and then click the "Database Documenter" button in the "Analyze" section of
Posts: 1,093 Thanks: 1 Thanked 10 Times in 9 Posts No problem, Enoch. Check This Out Any suggestions? I really appreciate both of you taking the time to help me out. Posts: 26,373 Thanks: 0 Thanked 2,403 Times in 2,372 Posts Re: Run-time error 3022 with .AddNew A sub and a function are literally the same except that the latter returns a
rst.AddNew'Preparerecordsetforanewrecord. HAs soon as you start entering a new record, your task no will be incremented by 1 and saved to your table when you close the form/navigate to a new record I am wondering why the Form_Error event is not triggered. Source Contact Us - Wrox - Privacy Statement - Top Powered by vBulletin Copyright ©2000 - 2016, Jelsoft Enterprises Ltd. © 2013 John Wiley & Sons, Inc.
I'm afraid I may have a corrupt table or something. vbaInet View Public Profile Find More Posts by vbaInet « Previous Thread | Next Thread » Thread Tools Show Printable Version Email this Page Display Modes 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!
Can you post a stripped down version your db so I can have a quick look. Apr 9 '11 #3 reply 100+ P: 137 Adam Tippelt Thanks for the response NeoPa. At this line in my code: me.requery I'm getting the "runtime error 3022"--value cannot be entered into the table because there is a duplicate value in the (primary-keyed) field.elp! Player claims their wizard character knows everything (from books).
Share Share this post on Digg Del.icio.us Technorati Twitter Using Office 2003 & 2010, I'm 1 of the 10 people that don't understand binary. I think Access automatically sets the indexed property to Yes(No Duplicates) for the primary key fields. Try trapping it within your close button code - use resume next for the part that might trigger an error, and check. have a peek here Michael.K View Public Profile Find More Posts by Michael.K 07-09-2010, 09:57 AM #6 vbaInet AWF VIP Join Date: Jan 2010 Location: U.K.
What are the alternatives to compound interest for a Muslim? No answer to your post? I am wondering why the Form_Error event is not triggered. Any ideas?
True and this would depend on how it's been dimensioned. Ed Robichaud wrote: One common technique is to use the BeforeUpdate of the combobox to run a DLookup of the underlying table and check for any matching records, then either add Since I am not familiar with the package you mention I can only guess at what is going on, but here goes...It seems that there is a field somewhere that must IfReadBLOB(txtPath.Value,rst,"Screenshot")=1Then'StoresthebinarydataseemodBlobforReadBLOBfunction.
If you apply for a job at the help desk at Microsoft, I'll be glad to give you a good reference!!!How for the specifics I didn't include in the last message: I am wondering why the Form_Error event is not triggered.