Add table to backend via code

Rachael

Registered User.
Local time
Today, 20:13
Joined
Nov 2, 2000
Messages
205
I was wondering if someone could point me in the right direction on figuring out how to add a new table to a backend database and relink to the frontend via code. I need to be able to do this from the frontend as I have distributed the f/e and b/e.

Thankyou
Rachael
 
You can add a table to the backend using the transferdatabase method.

Use something like:

DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\Fullpathwithextensionofbackend", acTable, "Tbl_NewTable", "Tbl_NewTable", False

The first reference to Tbl_NewTable is the table you wish to transfer. The second reference to Tbl_NewTable is the name which you want the table to be known as in the destination db.

The False refers to StructureOnly (thus False transfers data also) - you choose the option that suits.

As far as relinking, create the new frontend with the link already established.

HTH

Brad
 
Thanks Brad, sounds easy when you put it like that , I was thinking it would be much more complicated.

I see you're a fellow Victorian and VB fan, Victoria Bitter that is, not a bad brew!!

Once again thanks for the solution

Cheers,

Rachael
 
Hmmm,

"Matter of fact I got it now."

Cheers.
 

Users who are viewing this thread

Back
Top Bottom