Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete and Replace Table

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
Hi All, I want to delete a table in a back-end database and then move a table from a second database into the first to replace the one deleted. It's basically a simple swap. When a form opens up in the front-end database the code will delete the back-end table and move its replacement from the front-end to the back-end.

Is this possible? if so any thought on getting started is greatly appreciated.

Thanks
 
DoCmd.DeleteObject acTable, "Former Employees Table"

DoCmd.TransferDatabase acImport, "Microsoft Access", "pathandFileName, acTable, "sourcetblName", "destinationtblName", False

Look in the help file for these two methods. Examples shown.
 
How are ya EddyLLC . . .

Note: If the table is a parent the child tables need to be deleted first!
Code:
[blue]DBEngine(0)(0).Execute ("DROP TABLE [purple][b][i]tablename[/i][/b][/purple];")[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top