I have two related tables, company is the one table, areas the many
I want to be able to delete records in the many table that match the criteria of a field in company
I have no problems selecting the records with the following;
-----------
Private Sub areas_find_empty_records_Click()
Dim stDocName As String
Dim strSQL As String
stDocName = "areas_find_empty_records"
strSQL = "SELECT * FROM areas INNER JOIN company ON areas.[areas#] = company.[record#]" _
& "WHERE company.main_name= 'empty'"
Me.RecordSource = strSQL
End Sub
-------------------------
I then replace SELECT with DELETE and I am asked to specify the table I want to delete the records from. So I have tried areas, [areas], [areas.*] but I keep getting the same error message
Any thoughts?
I want to be able to delete records in the many table that match the criteria of a field in company
I have no problems selecting the records with the following;
-----------
Private Sub areas_find_empty_records_Click()
Dim stDocName As String
Dim strSQL As String
stDocName = "areas_find_empty_records"
strSQL = "SELECT * FROM areas INNER JOIN company ON areas.[areas#] = company.[record#]" _
& "WHERE company.main_name= 'empty'"
Me.RecordSource = strSQL
End Sub
-------------------------
I then replace SELECT with DELETE and I am asked to specify the table I want to delete the records from. So I have tried areas, [areas], [areas.*] but I keep getting the same error message
Any thoughts?