Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Dim i As Integer Dim sDir As String Dim sFilename As String Dim sDirFile As String Dim sTables() As String Dim sExpTable() As String Dim ws As Workspace Dim db As Database ReDim sTables(0) ReDim sExpTable(0) ReDim Preserve sTables(3) ReDim Preserve sExpTable(3) sTables(1) = "dbo_v_pub_exp_mall_usa" sTables(2) = "dbo_v_pub_exp_stores_all_usa" sTables(3) = "dbo_v_pub_exp_stores_anchor_usa" sExpTable(1) = "mall_usa" sExpTable(2) = "stores_all_usa" sExpTable(3) = "stores_anchor_usa" 'Get default Workspace Set ws = DBEngine.Workspaces(0) 'Path and file name for new mdb file sDir = "C:\Projects\Direct\export-data-partners\exports\" sFilename = "NewDB.mdb" sDirFile = sDir & sFilename 'Make sure there isn't already a file with the name of the new database If Dir(sDirFile) <> "" Then Kill sFilename 'Create a new mdb file Set db = ws.CreateDatabase(sDirFile, dbLangGeneral) For i = 1 To UBound(sTables) 'For lookup tables, export both table definition and data to new mdb file DoCmd.TransferDatabase acExport, "Microsoft Access", sDirFile, acTable, sTables(i), sExpTable(i) & "_imp", False Next i db.Close Set db = Nothing
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Trying to figure out how to design a form||4||58|
|Why can't I change data in my query?||3||33|
|How to requery/refresh another form in VBA if you only know its name as a string.||5||46|
|Cant delete records in query||8||42|
Join the community of 500,000 technology professionals and ask your questions.