Results 1 to 6 of 6
  1. #1
    Carrinmere is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    15

    Run-time error '2105': You can't go to the specified record

    So I created a database using PersonnelSSN as the PK for my parent table and then TrainingSSN, MobilitySSN, etc. as the foreign key (and PK for their respective tables) for other related tables. After I built the database, however, I discovered that Sharepoint will not recognize anything but ID Autonumber as the PK for any table exported to it which I need to do with my back end for the database to work. To correct this I added an ID Autonumber for every table but kept the relationships mentioned above. When I do that I get the error Run-time error '2105': You can't go to the specified record when my database attempts to open a new record from any form I have created. When I run the debug code it highlights DoCmd.GoToRecord , , acNewRec in my VBA script. I am at a loss at how to fix this. The DB works fine if I change every tables PK to ID Autonumber except the tbl_Personnel, but the moment I change the tbl_Personnel to ID Autonumber as the PK with PersonnelSSN as just a unique field in the table my GoTo New Record Macros and VBA scripts shit the bed. Thoughts?



    Carrinmere

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    If the autonumber is designated as primary key then you need to use it as such. Store it as foreign key in related tables and establish relationships on those fields, not SSN. SSN should not be a key field anyway. The SSN should reside in only one table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Carrinmere is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    15
    If SSN only resides in one table, what am I using to build the relationship when all PKs for each table are an ID Autonumber?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    A long integer field in related tables will store ID of parent table as a foreign key value. Whenever need to view SSN in report include parent table in query used as report RecordSource. This is basic relational database concept. The autonumber ID fields of dependent tables are not involved in primary/foreign key relationship with parent table.
    Last edited by June7; 08-26-2021 at 09:16 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    I'd say that this is at best, a continuation of a prior thread, or at worst, cross posting

    https://www.accessforums.net/showthread.php?t=84277
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Without being able to see all of the fields in the tables, this is how I would start designing the tables and the relationships:

    Click image for larger version. 

Name:	TableDesign1.png 
Views:	13 
Size:	133.0 KB 
ID:	46077

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Run time error 2105 at end of continuous form
    By apk19 in forum Programming
    Replies: 5
    Last Post: 02-05-2021, 10:34 AM
  2. Run-time error 2105
    By flantrains in forum Programming
    Replies: 3
    Last Post: 12-09-2019, 12:53 AM
  3. Replies: 7
    Last Post: 09-13-2017, 06:36 AM
  4. Replies: 1
    Last Post: 01-10-2014, 09:51 AM
  5. Replies: 1
    Last Post: 06-04-2012, 03:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums