Share via

Access error code 2105. can't go to specified record

Anonymous
2019-05-13T15:23:05+00:00

I moved this db to a new machine and now getting and Access error code 2105, cant go to specified record when selecting the add record button.

This is coming from a working machine and Access 2007.  The new machine is running Access 365.  The form button giving the error is Command75. It is probably something simple I am overlooking but I have exhausted all theories.  Any help is much appreciated.

This is the code:

Option Compare Database

Private Sub New_Record_Click()

On Error GoTo Err_New_Record_Click

    Dim stDocName As String

    stDocName = "Update Vendor Name"

    DoCmd.RunMacro stDocName

Exit_New_Record_Click:

    Exit Sub

Err_New_Record_Click:

    MsgBox Err.Description

    Resume Exit_New_Record_Click

End Sub

Private Sub Command34_Click()

On Error GoTo Err_Command34_Click

    DoCmd.GoToRecord , , acLast

Exit_Command34_Click:

    Exit Sub

Err_Command34_Click:

    MsgBox Err.Description

    Resume Exit_Command34_Click

End Sub

Private Sub Command39_Click()

On Error GoTo Err_Command39_Click

    DoCmd.GoToRecord , , acPrevious

Exit_Command39_Click:

    Exit Sub

Err_Command39_Click:

    MsgBox Err.Description

    Resume Exit_Command39_Click

End Sub

Private Sub Command40_Click()

On Error GoTo Err_Command40_Click

    DoCmd.GoToRecord , , acNext

Exit_Command40_Click:

    Exit Sub

Err_Command40_Click:

    MsgBox Err.Description

    Resume Exit_Command40_Click

End Sub

Private Sub Command41_Click()

On Error GoTo Err_Command41_Click

    DoCmd.GoToRecord , , acLast

Exit_Command41_Click:

    Exit Sub

Err_Command41_Click:

    MsgBox Err.Description

    Resume Exit_Command41_Click

End Sub

Private Sub Command45_Click()

On Error GoTo Err_Command45_Click

    Dim stDocName As String

    stDocName = "Open Rankin table"

    DoCmd.RunMacro stDocName

Exit_Command45_Click:

    Exit Sub

Err_Command45_Click:

    MsgBox Err.Description

    Resume Exit_Command45_Click

End Sub

Private Sub Add_Record_Click()

On Error GoTo Err_Add_Record_Click

    DoCmd.GoToRecord , , acNewRec

Exit_Add_Record_Click:

    Exit Sub

Err_Add_Record_Click:

    MsgBox Err.Description

    Resume Exit_Add_Record_Click

End Sub

Private Sub Command50_Click()

On Error GoTo Err_Command50_Click

    DoCmd.GoToRecord , , acNewRec

Exit_Command50_Click:

    Exit Sub

Err_Command50_Click:

    MsgBox Err.Description

    Resume Exit_Command50_Click

End Sub

Private Sub Command61_Click()

On Error GoTo Err_Command61_Click

    Dim stDocName As String

    stDocName = "invoice amount"

    DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command61_Click:

    Exit Sub

Err_Command61_Click:

    MsgBox Err.Description

    Resume Exit_Command61_Click

End Sub

Private Sub Command62_Click()

On Error GoTo Err_Command62_Click

    Dim stDocName As String

    stDocName = "invoice amount"

    DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command62_Click:

    Exit Sub

Err_Command62_Click:

    MsgBox Err.Description

    Resume Exit_Command62_Click

End Sub

Private Sub Run_Submit_Query_Click()

On Error GoTo Err_Run_Submit_Query_Click

    Dim stDocName As String

    stDocName = "Submit"

    DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Run_Submit_Query_Click:

    Exit Sub

Err_Run_Submit_Query_Click:

    MsgBox Err.Description

    Resume Exit_Run_Submit_Query_Click

End Sub

Private Sub Vendor_TTL_Click()

On Error GoTo Err_Vendor_TTL_Click

    Dim stDocName As String

    stDocName = "Vendor Totals by Date Range"

    DoCmd.OpenReport stDocName, acPreview

Exit_Vendor_TTL_Click:

    Exit Sub

Err_Vendor_TTL_Click:

    MsgBox Err.Description

    Resume Exit_Vendor_TTL_Click

End Sub

Private Sub Site_TTLS_Click()

On Error GoTo Err_Site_TTLS_Click

    Dim stDocName As String

    stDocName = "Site Totals"

    DoCmd.OpenReport stDocName, acPreview

Exit_Site_TTLS_Click:

    Exit Sub

Err_Site_TTLS_Click:

    MsgBox Err.Description

    Resume Exit_Site_TTLS_Click

End Sub

Private Sub Site_Totals_Click()

On Error GoTo Err_Site_Totals_Click

    Dim stDocName As String

    stDocName = "Site Totals"

    DoCmd.OpenReport stDocName, acPreview

Exit_Site_Totals_Click:

    Exit Sub

Err_Site_Totals_Click:

    MsgBox Err.Description

    Resume Exit_Site_Totals_Click

End Sub

Private Sub Command73_Click()

On Error GoTo Err_Command73_Click

    Dim stDocName As String

    stDocName = "Add Record"

    DoCmd.RunMacro stDocName

Exit_Command73_Click:

    Exit Sub

Err_Command73_Click:

    MsgBox Err.Description

    Resume Exit_Command73_Click

End Sub

Private Sub Command75_Click()

On Error GoTo Err_Command75_Click

    Dim stDocName As String

    stDocName = "Add Record"

    DoCmd.RunMacro stDocName

Exit_Command75_Click:

    Exit Sub

Err_Command75_Click:

    MsgBox Err.Description

    Resume Exit_Command75_Click

End Sub

Private Sub Vendor_by_Date_Click()

On Error GoTo Err_Vendor_by_Date_Click

    Dim stDocName As String

    stDocName = "Vendot TTL by Date Range"

    DoCmd.OpenReport stDocName, acPreview

Exit_Vendor_by_Date_Click:

    Exit Sub

Err_Vendor_by_Date_Click:

    MsgBox Err.Description

    Resume Exit_Vendor_by_Date_Click

End Sub

Private Sub Siter_by_Date_Click()

On Error GoTo Err_Siter_by_Date_Click

    Dim stDocName As String

    stDocName = "Site by Date Range"

    DoCmd.OpenReport stDocName, acPreview

Exit_Siter_by_Date_Click:

    Exit Sub

Err_Siter_by_Date_Click:

    MsgBox Err.Description

    Resume Exit_Siter_by_Date_Click

End Sub

Private Sub Inv_Info_Click()

On Error GoTo Err_Inv_Info_Click

    Dim stDocName As String

    stDocName = "Inv Info"

    DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Inv_Info_Click:

    Exit Sub

Err_Inv_Info_Click:

    MsgBox Err.Description

    Resume Exit_Inv_Info_Click

End Sub

Private Sub Accnt_Code_Click()

On Error GoTo Err_Accnt_Code_Click

    Dim stDocName As String

    stDocName = "Account Code by Date"

    DoCmd.OpenReport stDocName, acPreview

Exit_Accnt_Code_Click:

    Exit Sub

Err_Accnt_Code_Click:

    MsgBox Err.Description

    Resume Exit_Accnt_Code_Click

End Sub

Private Sub Command80_Click()

On Error GoTo Err_Command80_Click

    DoCmd.Quit

Exit_Command80_Click:

    Exit Sub

Err_Command80_Click:

    MsgBox Err.Description

    Resume Exit_Command80_Click

End Sub

Private Sub Open_vendor_table_Click()

On Error GoTo Err_Open_vendor_table_Click

    Dim stDocName As String

    stDocName = "Open Vendor Table"

    DoCmd.RunMacro stDocName

Exit_Open_vendor_table_Click:

    Exit Sub

Err_Open_vendor_table_Click:

    MsgBox Err.Description

    Resume Exit_Open_vendor_table_Click

End Sub

Private Sub AP_Listing_Click()

On Error GoTo Err_AP_Listing_Click

    Dim stDocName As String

    stDocName = "AP Listing"

    DoCmd.OpenReport stDocName, acPreview

Exit_AP_Listing_Click:

    Exit Sub

Err_AP_Listing_Click:

    MsgBox Err.Description

    Resume Exit_AP_Listing_Click

End Sub

Private Sub Vendor_by_Date_Range_Click()

On Error GoTo Err_Vendor_by_Date_Range_Click

    Dim stDocName As String

    stDocName = "Vendor by Date Range"

    DoCmd.OpenReport stDocName, acPreview

Exit_Vendor_by_Date_Range_Click:

    Exit Sub

Err_Vendor_by_Date_Range_Click:

    MsgBox Err.Description

    Resume Exit_Vendor_by_Date_Range_Click

End Sub

Private Sub Vendor_by_Date_Range2_Click()

On Error GoTo Err_Vendor_by_Date_Range2_Click

    Dim stDocName As String

    stDocName = "Vendor_id and Date Range"

    DoCmd.OpenReport stDocName, acPreview

Exit_Vendor_by_Date_Range2_Click:

    Exit Sub

Err_Vendor_by_Date_Range2_Click:

    MsgBox Err.Description

    Resume Exit_Vendor_by_Date_Range2_Click

End Sub

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

12 answers

Sort by: Most helpful
  1. Anonymous
    2019-05-13T18:50:28+00:00

    Sounds like the database might not be in a Trusted Location.  Have a look at...

    https://www.access-diva.com/d4.html

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-05-13T17:27:37+00:00

    Scott,

    I just noticed on the original machine, the add record option is available next to the record counter but on the new machine it is grey'd out.

    There must be an Options setting that I am missing? 

    Thanks.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-05-13T17:25:58+00:00

    Scott,

    I just noticed on the original machine, the add record option is available next to the record counter but on the new machine it is grey'd out.

    There must be an Options setting that I am missing?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-05-13T16:53:06+00:00

    Thanks for the reply.  Unfortunately, I'm just the messenger.  This db has been in place for probably 8 years or so.  Sometimes it breaks when an update is applied, etc but for the most part the Accounts Payable clerk says it's solid for her needs.  I am the department's support staff but Access is not my specialty.  Just know enough to be dangerous.  But after trying to read the code I thought the same as you suggested on the naming conventions.

    1.  When I open VB Editor, Tools, References it open to the options Available options lists:  check marked are Visual Basic for applications, MS Access 16.0 object library, OLE automation, and MS active data objects 2.1 library.  I select OK and nothing appears to happen.  

    Please advice which options should be check marked.

    Thanks in advance.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2019-05-13T15:27:54+00:00

    I don't see anything wrong with the code, unless you don't have that macro named in Command75.

    Have you checked references on the new machine? To do that, open the Visual Basic Editor and click Tools - References. Are any marked as MISSING? If so, you'll have to fix that.

    Also, is the location where the database is stored setup as a Trusted Location? If not, you'll need to do that. Here's an article that talks about that:

    https://support.office.com/en-us/article/add-remove-or-change-a-trusted-location-7ee1cdc2-483e-4cbb-bcb3-4e7c67147fb4

    On a design note: You really, really should give meaningful names to you controls. Command75 should probably be named something like "cmAddRecord". That's not your problem, of course, but it's a good habit to get in.

    Was this answer helpful?

    0 comments No comments