Hi Parkjv1,
Thank you for you reply. I got your code + my code (as below) and now my
situation & code right now are:
My application name "MyProject" when it open is linked to an external
database name "oldDB.mdb". There's one command button in switchboard called
"Create new database". and that button has the following code:
Dim ws As Workspace
Dim dbNew As dao.Database
Dim NewFilename As String
'Get default Workspace
Set ws = DBEngine.Workspaces(0)
'Path and file name for new mdb file
NewFilename = "c:\Test\NewDB.mdb"
'Make sure there isn't already a file with the name of the new database
If Dir(NewFilename) <> "" Then Kill LFilename
'Create a new mdb file
Set dbNew = ws.CreateDatabase(NewFilename, dbLangGeneral)
'For data entry tables, export only table definition to new mdb file
DoCmd.TransferDatabase acExport, "Microsoft Access", NewFilename, acTable,
"MyTestTable", "MyTestTable", structureonly:=True
dbNew.Close
Set dbNew = Nothing
It created a "NewDB.mdb" with a table "MyTestTable" (which is what I wanted)
perfectly. But when I open "NewDB.mdb", "MyTestTable" is link to "oldDB.mdb".
I don't want that "NewDB.mdb" link to any where else (when I open it by
itself) and I also want "MyProject" (which I still open after created a new
database) to relink to "NewDB.mdb" instead of "oldDB.mdb". I called the
relink function (after set dbNew =nothing ) that I have to link at the
beginning but somehow i got a message said that it can't find "MyTestTable"...
Do you know how to drop the link for the new created database and relink
that new created database to my current open application?
Thanks for your reply
Violette
> > Hi all,
> >
[quoted text clipped - 45 lines]
>
> John
parkjv1@comcast.net - 30 Aug 2006 01:59 GMT
Hi,
I apologize for not answering in quite some time....
I have been trying to get some serious projects done around the house
prior to this winter. I have an old farm house built in 1916 with
original windows.....very time consuming.....I'm currently at work and
I'm heading home....I will read this more tomorrow and then get back to
you...that is if you haven't found a solution yet...
Tks,
> Hi Parkjv1,
> Thank you for you reply. I got your code + my code (as below) and now my
[quoted text clipped - 86 lines]
> >
> > John
V.P. - 31 Aug 2006 23:01 GMT
Hi John,
Thanks, don't bother cuz I finished that project. Now I move on to other
projects so I may have some more questions later on. But again, thanks for
reply. Wish you doing well...
Appreciated it.
VP
> Hi,
>
[quoted text clipped - 98 lines]
> > >
> > > John