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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot delete entire table because of relationship.

Status
Not open for further replies.

bunglefoot

Programmer
Jul 30, 2004
5
CA
Hey, I finished all my queries etc and attached them to cmdbuttons. Now, I need to make a command button that deletes an entire table. I have completed this, but when I click the button it informs me that it cannot delete the table because it has an existing relationship with another table (that I dont want to delete). How can I eliminate this relationship using a command button? Thanks.
 
One more thing, does anyone offhand know how to create a command button that can import an ODBC database without using the import menu in access? I am creating this thing for people who have basically no computer skills, and would prefer them to just click a button as opposed to navigate a huge menu.
 
bunglefoot
You have to delete the relationship before deleting the table.
 
why don't you just delete all the records from the table instead of deleting the table itself? Then you don't have to deal with the relationship at all.

leslie
 
Hi

On your second point Importing an ODBC Database, I assume you mean importing a table From an ODBC database

See the various flavours of DoCmd.Transfer... in help...

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Leapaul,

I'm wondering about the first question too. What would the code be to delete/recreate the relationship? It's easy enough through the relationships view but how to automate it?
 
just a little bump so to speak. I'm also trying to do something simular. I have a command button that activates a macro thats been set to open the import window, user selects tables to import, append queries to take the data from the original imported tables and appends the data to new empty versions of the tables, deletes the original imported tables, and thats it.

Basically, this is to make upgrading from one version of the db to another with ease for those that aren't so, access literate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top