
Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
Hi Allen
Code is:
Sub subCreateNewTable()
Dim dbNew As Database ' The new
database object
Set ws = DBEngine.Workspaces(0) ' Create workspace
strNewTables = Forms!frmUpgrade.txtPath & "PA5_Data_Tables.mdb" '
The file to export to
If Dir(strNewTables) <> "" Then 'Make sure there
isn't already a file with that name
Kill strNewTables
End If
Set dbNew = ws.CreateDatabase(strNewTables, dbLangGeneral) ' Create
the database
' Identify records to export
Set dbs = CurrentDb ' Nominate the
database
strSQL = "SELECT DISTINCT MSysObjects.Name, MSysObjects.Type " & _
"FROM MSysObjects " & _
"WHERE (((MSysObjects.Name) Not Like ""msys*"") AND
((MSysObjects.Type)=1));"
Set rst = dbs.OpenRecordset(strSQL) ' Recordset of
table names
Do While Not rst.EOF ' Export each
table (rst!Name is the table name)
If Left(rst!Name, 1) = "t" Then ' Only export
tables starting with tbl....
subDisplayProgress "Exporting " & (rst!Name) & _
" to PA5_Data_Tables.mdb" ' Display
progress
DoCmd.TransferDatabase acExport, "Microsoft Access", _
strNewTables, acTable, rst!Name, rst!Name, False
End If
rst.MoveNext
Loop
subHideProgress ' Hide the
progress label
Set dbs = Nothing ' Clean up
Set dbsNew = Nothing
Set rst = Nothing
End Sub
> A2007 is exporting to a new file? How do you create that file?
>
[quoted text clipped - 44 lines]
> >> > rectify
> >> > it without creating a separate 2007 version?
Allen Browne - 23 Jul 2007 10:10 GMT
So did you try adding the dbVersion40 to the CreateDatabase line as
suggested?

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hi Allen
>
[quoted text clipped - 61 lines]
>>
>> You should be able to add dbVersion40 to get it to create the MDB format.
NevilleT - 24 Jul 2007 06:16 GMT
Have made the changes and am waiting for my South African client to come
online and test it. Will keep you posted Allen. Thanks again from the other
side of the continent.
> So did you try adding the dbVersion40 to the CreateDatabase line as
> suggested?
[quoted text clipped - 64 lines]
> >>
> >> You should be able to add dbVersion40 to get it to create the MDB format.
NevilleT - 24 Jul 2007 07:38 GMT
Thanks again Allen. It worked. One day I will get to Perth and buy you a
well earned beer.
> Have made the changes and am waiting for my South African client to come
> online and test it. Will keep you posted Allen. Thanks again from the other
[quoted text clipped - 68 lines]
> > >>
> > >> You should be able to add dbVersion40 to get it to create the MDB format.