Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy a Table From FE to BE? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have the following code on a Form button.

    I want to delete the table tbl_RPS_Owner_WSC_01_Input in Build_Be.mdb BE

    Then copy table tbl_RPS_Owner_WSC_01_Input_AN_0 in Build.mdb FE to

    tbl_RPS_Owner_WSC_01_Input in Build_Be.mdb BE

    ' Drop Table
    DoCmd.DeleteObject acTable, "tbl_RPS_Owner_WSC_01_Input"

    ' Copy tbl_RPS_Owner_WSC_01_Input_AN_0 to tbl_RPS_Owner_WSC_01_Input
    DoCmd.CopyObject "F:AppsAccess2kBuildLewBuild_Be.mdb", _
    "tbl_RPS_Owner_WSC_01_Input", _
    acTable, _
    "tbl_RPS_Owner_WSC_01_Input_AN_0"

    Iím getting message that it canít find tbl_RPS_Owner_WSC_01_Input

    The whole purpose is to initialize a empty table tbl_RPS_Owner_WSC_01_Input in Build_Be.mdb with autonumber reset

    Thakns, John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy a Table From FE to BE? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    The line

    DoCmd.DeleteObject acTable, "tbl_RPS_Owner_WSC_01_Input"

    acts on the table in the current database, i.e. the frontend database. Once you've deleted the table from the frontend, the code cannot find it any more when you try to copy it to the backend, of course.

    You could use DAO to delete the backend table:

    Dim dbs As DAO.Database
    Set dbs = OpenDatabase("F:AppsAccess2kBuildLewBuild_Be.mdb")
    dbs.TableDefs.Delete "tbl_RPS_Owner_WSC_01_Input"
    dbs.Close
    Set dbs = Nothing

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy a Table From FE to BE? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Thanks, that did it

    Is there any advantage/disadvantage of using DoCmd.CopyObject vrs. DoCmd.TransferDatabase acExport

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy a Table From FE to BE? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    > Is there any advantage/disadvantage of using DoCmd.CopyObject vrs. DoCmd.TransferDatabase acExport

    I don't know - I think you can use them interchangeably.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •