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 ClarkeOP
@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.
Do you have data already in the Table that has duplicates?
Robert ClarkeOP
@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.
If you open up the Form manually and try and add a Record what happens?
Robert ClarkeOP
@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.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.