Run-time error 2105

randolphoralph

Registered User.
Local time
Today, 08:59
Joined
Aug 4, 2008
Messages
101
On my main form I have the Form On Current event set to Me.AllowAdditions = False to prevent new records from being added when users use the scroll button on the mouse.

In order to add a new record users have to click on a command button.

The database has been running smoothly for about a month now, and starting last week users started getting a error message...Run-time error '2105': You can't go to the specified record. This happens when the users click the command button to add a new record.

When I click on Debug it points to DoCmd.GoToRecord acActiveDataObject, , acNewRec

The complete code is


Code:
Private Sub AddNewCommandButton_Click()
Me.AllowAdditions = True
DoCmd.GoToRecord acActiveDataObject, , acNewRec
End Sub
 
Use the before update event to verify if the user can save the current record.

Check out the programming for saving, undo and testing if a record is dirty [has been modified but not saved] in my old A Better Mouse Trap? sample.
 
ghudson I have looked over your sample and I am trying to avoid adding a save button, but will look at the information and see if I can modify it to work for my situation. It is really good code and I may use it in the future. Currently, I do not have the Before Update Event to save or check if the record is dirty. I have not used the Dirty and Save record before so I will have to figure out how to do the code for that since that may help.

I am at a loss for what is causing the error. I did notice today that when one user got the error message it was around the same time that another user had deleted a record, but not sure if this could cause the error since it is only happening when the users are adding a new record.

Maybe a corrupt form?
 
Last edited:
The database has been running smoothly for about a month now, and starting last week users started getting a error message...Run-time error '2105': You can't go to the specified record. This happens when the users click the command button to add a new record.
Since your code was working for a month with no problems. I would tend to suspect you received some type of a update either from Microsoft or the IT guys i.e. SQL update...Just a thought.
 
I was thinking something had to change either the database or other changes. The problem is the company I work for has a huge IT department and trying to get a solid answer out of them is not going to happen. No offense against anyone in the IT field as you have some great IT folks and then you have others.

The funny thing is the error only happens every once in awhile and I can not replicate it.
 
I was thinking something had to change either the database or other changes. The problem is the company I work for has a huge IT department and trying to get a solid answer out of them is not going to happen.
You're preaching to the choir - I'm in the same boat.

The funny thing is the error only happens every once in awhile and I can not replicate it.
The question is how often it happens and how devastating it really is. I say this because neither Windows nor any other operating system will ever be perfectly stable. We've learned to live with a number of errors that occur intermittently, because our IT dept doesn't have time to debug every problem. Sometimes the user has to reboot to get rid of an error.

I hope the problem isn't devastating to your project.
 
Well I just found out this morning that since users started getting this error they are randomly getting another error. The error is Write Conflict "This record has been changed by another user since you started editing it......"

This error is happening in the same place as the other error when the users click the command button to add a new record. When the user received the error message they were the only one in the database as the other users were not at work yet.

The user that received the error is accessing the database from a shared server across a WAN.
 

Users who are viewing this thread

Back
Top Bottom