J
John Ortt
Hi Everyone,
This is a follow-on message from my previous post entitled:
"Can I run an update Query on the MSysObjects Table?"
I have now decided (been persuaded) that this is not the best way to do what
I want to achieve.
I have looked at http://www.mvps.org/access/tables/tbl0009.htm in the hope
of figuring out how to apply the code to my application but I fear it is way
above my knowledge level.
Essentially I wish to swap the links between two databases. The code below
shows a converted macro which did this for a single table, but there could
be dozens of tables and I don't want to repeat the code for each one. I
also want the code to be future proof and search out each table which needs
changing to ensure that new tables which are added are automatically
included.
If anybody can give me any pointers I would be very grateful.
Thankyou,
John.
CODE FOLLOWS:
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Function LinkTo1()
DoCmd.DeleteObject acTable, "1"
DoCmd.TransferDatabase acLink, "Microsoft Access", "H:\Temp\New
Folder\1\DATABASE.mdb", acTable, "1", "1", False
End Function
Function LinkTo2()
DoCmd.DeleteObject acTable, "1"
DoCmd.TransferDatabase acLink, "Microsoft Access", "H:\Temp\New
Folder\2\DATABASE.mdb", acTable, "1", "1", False
End Function
This is a follow-on message from my previous post entitled:
"Can I run an update Query on the MSysObjects Table?"
I have now decided (been persuaded) that this is not the best way to do what
I want to achieve.
I have looked at http://www.mvps.org/access/tables/tbl0009.htm in the hope
of figuring out how to apply the code to my application but I fear it is way
above my knowledge level.
Essentially I wish to swap the links between two databases. The code below
shows a converted macro which did this for a single table, but there could
be dozens of tables and I don't want to repeat the code for each one. I
also want the code to be future proof and search out each table which needs
changing to ensure that new tables which are added are automatically
included.
If anybody can give me any pointers I would be very grateful.
Thankyou,
John.
CODE FOLLOWS:
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Function LinkTo1()
DoCmd.DeleteObject acTable, "1"
DoCmd.TransferDatabase acLink, "Microsoft Access", "H:\Temp\New
Folder\1\DATABASE.mdb", acTable, "1", "1", False
End Function
Function LinkTo2()
DoCmd.DeleteObject acTable, "1"
DoCmd.TransferDatabase acLink, "Microsoft Access", "H:\Temp\New
Folder\2\DATABASE.mdb", acTable, "1", "1", False
End Function