DELETE Functions!

voskouee

Registered User.
Local time
Today, 15:31
Joined
Jan 23, 2007
Messages
96
I have a tables that lists all the names of the tables i want to delete.

i want to write a procedure that will go and check the values of this table find the corresponding table delete the values. it will be repeated until no more values are found

this is what i have so far...

Dim rs As DAO.Recordset
Dim strSQL As String

Set rs = CurrentDb.OpenRecordset("SELECT SOBP FROM Countries;")
Do While Not rs.EOF

'delete all RN tables
DoCmd.SetWarnings (False)
strSQL = "DELETE " & rs!SOBP* " FROM " & rs!SOBP & "';"
DoCmd.RunSQL (strSQL)
DoCmd.SetWarnings (True)

rs.MoveNext

Loop

Thanks in advance
 
Try the following

strSQL = "DELETE " & rs!SOBP & ".* FROM " & rs!SOBP & "';"
 
It works great..


thank you so much!:)
 

Users who are viewing this thread

Back
Top Bottom