Add table to backend via code (1 Viewer)

Rachael

Registered User.
Local time
Today, 05:02
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
 

bradcccs

Registered User.
Local time
Today, 14:02
Joined
Aug 9, 2001
Messages
461
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
 

Rachael

Registered User.
Local time
Today, 05:02
Joined
Nov 2, 2000
Messages
205
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
 

bradcccs

Registered User.
Local time
Today, 14:02
Joined
Aug 9, 2001
Messages
461
Hmmm,

"Matter of fact I got it now."

Cheers.
 

Users who are viewing this thread

Top Bottom