docmd.Sendtable

I have a Table in database 1 that I  need to transfer to database 2(identical table).  

Here is the code I have so far!

and this is the line I need help with" "combined" ="


''''''''''''''''''''''''''''''''''''''
Option Compare Database
Option Explicit

Private Sub cmdDBPassword_Click()
OpenAccess

End Sub
Sub OpenAccess()

    Dim LPath As String
    Dim LCategoryID As Long
    Const DBPWD = "OPPS"

   
   
    'Path to Access database
    LPath = "\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\volume.mdb"

    'Open Access and make visible
    Set oApp = CreateObject("Access.Application")
    oApp.Visible = True

    'Open Access database as defined by LPath variable and , false, dbpwd for password
    oApp.OpenCurrentDatabase LPath, False, DBPWD
 
    ADOFrromAccessToAccess

End Sub



Sub ADOFrromAccessToAccess()
' exports data from the active Access database to another Access Database
' this procedure must be edited before use
Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
Dim Connection As ADODB.Connection
Dim Recordset As ADODB.Recordset
   
   
    ' connect to the Access database
    Set cn = New ADODB.Connection
   
 
  ''''''''''''''''''''''''''''''''''''''''
  'Workgroup Security
cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
cn.ConnectionString = "Data Source=\\Dtcnas-ilsp002\mandatory\Analysts - Working Files\Carol\Demo\volume.mdb;Jet OLEDB:Database Password=OPPS;"
cn.Properties("Jet OLEDB:System database") = "C:\Program Files\Microsoft Office\system.mdw"
cn.Open


'''''''''''''''''''''''''
     
    ' open a recordset
    Set rs = New ADODB.Recordset
    rs.Open "Combined", cn, adOpenKeyset, adLockOptimistic, adCmdTable
      cn.Execute "delete * from Combined"
     
     
          docmd.Sendtable "combined" =
   
 
   
   
   
End Sub



ca1358Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tobydavidCommented:
Before I dig through all of your code, I have to ask if you knew about the docmd.copyobject function that would let you copy a table to a different database, as

docmd.copyobject "c:\mydir\database2.mbd","NewTableName", acTable, "OrigTableName"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ca1358Author Commented:
Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.