Results 1 to 6 of 6
  1. #1
    Bazsl is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Jun 2016
    Posts
    47

    Importing a table does NOT import the relationships


    Using Access 365 I import a table from another database that is identical to the current database except the source database has one additional table with relationships. When I import the table then view the relationships the relationships for the new table are not there. I am certain that I did check the Relationships checkbox when importing. Any idea what I am doing wrong? Thanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Stop importing tables,and import the data.
    either attach the extenal tbl then run an append qry to add the data to your table (w relationship already there)
    or
    use the transferdatabase to append data ,not make new table.

  3. #3
    Bazsl is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Jun 2016
    Posts
    47
    There is no data. The goal is to add an empty table and its relationships to a database at a remote location. I do not have remote access to the PC at the remote location so the import must be done by someone there using written instructions that I provide. The documentation on the MS Web site clearly states that importing a table will import its relationships as long as the Relationships checkbox in the import dialog is checked but I cannot get this to work. The table is imported but the relationships are not. I assume, therefore, that I am not doing something correctly. The question is, what?

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    It sounds like you are only importing a single table (OK into a db where those other tables already exist). But I think you will find that relationships are only imported when all the related tables are imported at the same time.

    You could provide your user with a queries to create the table and its relationships - see

    http://www.w3schools.com/sql/sql_create_table.asp to create a table
    http://www.w3schools.com/sql/sql_create_index.asp to add indexes
    http://www.w3schools.com/sql/sql_foreignkey.asp to add foreign keys (relationships)

  5. #5
    Bazsl is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Jun 2016
    Posts
    47
    Thanks Ajax. I was hoping to avoid using SQL to create the relationships since Access does not provide a means to execute a SQL script. However, SQL seems to be the only solution. Thanks again.

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    Access does not provide a means to execute a SQL script
    you would use vba.

    you could just send an 'update' db - written instructions would just be - open this db

    write vba code in a module to execute the three queries and exit the database and have the sub activated by an autoexec macro - or in a form if you want to show progress

    code would be something like (not checked for syntax)

    Code:
    Public Sub doUpdate()
    dim db as database
    
        set db=opendatabase("existing backend")
       db.execute ("create table....")
       db.execute("create index....")
       db.execute("alter table...") - note this can be done as part of the create table sql
       db.close
       msgbox "backend updated"
       docmd.quit
    
    end sub

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

Similar Threads

  1. Import errors when importing txt files
    By lenk73 in forum Access
    Replies: 4
    Last Post: 04-17-2015, 02:39 PM
  2. Replies: 4
    Last Post: 04-09-2015, 10:34 AM
  3. How do I Save/Import .txt file name to Access when importing?
    By PJ Crittenden in forum Import/Export Data
    Replies: 3
    Last Post: 11-05-2014, 07:40 AM
  4. Replies: 1
    Last Post: 06-02-2014, 07:15 AM
  5. Saved Import for Table with Relationships
    By garygoodguy in forum Import/Export Data
    Replies: 3
    Last Post: 04-21-2013, 08:07 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