Computer Learning Zone CLZ Access Excel Word Windows

I will choose a path that's clear. I will choose free will.

-Rush
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Visitor Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Runtime Error 2105
Robert Clarke 
  
15 months ago
I have written a simple code for a button

DoCmd.GoToRecord , , acNewRec

I am getting a error 2105, i have double check that the form properties meet the required parameters.

I found the problem in my table that a field is indexed to no duplicates allowed, but the form does not bring up the usual long message about duplicate values. instead it find this runtime error.

if i use the code on error resume the button does nothing and i don't want to do this method as the user will not know what is going on.

I would appreciate the help, even if i get the long winded standard message.
Kevin Robertson  @Reply  
          
15 months ago
Runtime Error 2105: You can't go to the specified record

Sounds like you have Allow Additions set to No.
Robert Clarke OP  @Reply  
  
15 months ago
My Allow Addtions,Deletions,Edits and Filters are all set to Yes.
I have a field that does not allow duplicates.
Only once I go into design view after adding data it warns me about Duplicate values in the record, but if I Add the record with a button with this command : Docmd.Gotorecord,,AcNewRec I get the runtime error.  If I remove the duplicates to allow in the table the code works fine.  But I would like the field to be indexed to no duplicates.
Alex Hedley  @Reply  
           
15 months ago
Do you have data already in the Table that has duplicates?
Robert Clarke OP  @Reply  
  
15 months ago
No I don't have duplicates in the table, but I was checking my form to see that everything works correctly, if a user try's to add a duplicate that the record will not be accepted.
Alex Hedley  @Reply  
           
15 months ago
If you open up the Form manually and try and add a Record what happens?
Robert Clarke OP  @Reply  
  
15 months ago
The form opens no problem, I can add records no problem and the button works perfectly.  Only once the specific field gets a value that is already in the table from a previous record, is when the button to add a record gives me a runtime error, if I put error resume next in front of the code, nothing happens, no standard warning about duplicate values, the only time I get a message is when I go back into design view, then Access warns me that a duplicate value is in a field.  Bear in mind there is no special code to detect duplicates on my form, the only place is in the table for that specific field I have said the index to no duplicates.
Richard Rost  @Reply  
          
15 months ago
Run down the troubleshooter. Could be something weird like you need to compact/repair.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Visitor Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 2:58:46 AM. PLT: 1s