pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Hi, I'm using below code, it copies the table from different database. I want to be able to copy it without any pop up warning and stating things like coune potentially dangerous etc.
Or if there is another way to copy the table but not linking....
Thanks in advance.
Or if there is another way to copy the table but not linking....
Thanks in advance.
Code:
[/FONT]
[FONT=Courier New] Dim strSourceDB As String
strSourceDB = "E:\Access\DAILY EXCERCISE\New folder\Database1.accdb"[/FONT]
[FONT=Courier New] Dim dbSource As DAO.Database
Dim tdf As DAO.TableDef
DoCmd.SetWarnings False
Set dbSource = DBEngine.OpenDatabase(strSourceDB)
For Each tdf In dbSource.TableDefs
If tdf.Name = "MyTable" Then
DoCmd.TransferDatabase _
acImport, _
"Microsoft Access", _
strSourceDB, _
acTable, _
tdf.Name, _
tdf.Name
End If
Next tdf
Set cnt = Nothing
DoCmd.SetWarnings True[/FONT]
[FONT=Courier New]