sql queries

N

Nassir

Hello guys
I'm using the Northwind database as an example on how to delete the
customers table becuse it has a + sign next to each row. I want to use SQL
queries DELETE stament becuse the table is related with the Orders table it
won't work for me
any idea will be much appriciated.
thanks
nassir
 
S

SusanV

SQL "Delete YourTable" will simply delete all the records in the table. To
delete the table itself using VBA, use
DoCmd.DeleteObject acTable, "YourTable"

You should verify first that the table actually exists to avoid an error:
If Not IsNull(DLookup("[Name]", "MSysObjects", "[Name] = 'YourTable'))
Then
DoCmd.DeleteObject acTable, "YourTable"
End If
 
J

John W. Vinson

Hello guys
I'm using the Northwind database as an example on how to delete the
customers table becuse it has a + sign next to each row. I want to use SQL
queries DELETE stament becuse the table is related with the Orders table it
won't work for me
any idea will be much appriciated.
thanks
nassir

Do you want to _delete the Table_ - destroying the entire table, all the data
in it, and its structure?

Or do you want to delete one or more records from the table?

The + sign just means that this Customer has Orders; you don't generally want
to delete a Customer record (or a customer table!) if that would leave
"orphan" Orders. It makes no business sense to say "I sold 24 cases of soft
drinks, but I don't have any idea who I sold them to"!

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top