Yesterday I learned how to update a table from a form to modify information.
Today...I want to delete a record from the same table...based on a checkbox on the same form.
So, in an access query I built this:
Dim strSql As String
strSql = "DELETE [Dup Temp Major ATA Table Create].Course, [Dup Temp Major ATA Table Create].MajorID, [Dup Temp Major ATA Table Create].Model, [Dup Temp Major ATA Table Create].ATA, [Dup Temp Major ATA Table Create].Subject, [Dup Temp Major ATA Table Create].[Teach Time], [Dup Temp Major ATA Table Create].Chapter, [Dup Temp Major ATA Table Create].Comments, [Dup Temp Major ATA Table Create].Hours, [Dup Temp Major ATA Table Create].Minutes, [Dup Temp Major ATA Table Create].[Remove Ch], [Dup Temp Major ATA Table Create].[Remove Comments], [Dup Temp Major ATA Table Create].[Remove Time]"
FROM [Dup Temp Major ATA Table Create]
WHERE ((([Dup Temp Major ATA Table Create].MajorID)=[Forms]![Dup Major Adjust Form]![MajorID]));" CurrentDb.Execute strSql
Me.Requery
But the WHERE statement fails. I thought I was following the syntax we used yesterday.
Also, I am not sure I need to identify all the fields. When I click the check box...bound to the table...I want that record to be deleted from the table.
Please help again. And, yes, I know my table naming convention is bad..I am working on that.
Thanks,
Today...I want to delete a record from the same table...based on a checkbox on the same form.
So, in an access query I built this:
Dim strSql As String
strSql = "DELETE [Dup Temp Major ATA Table Create].Course, [Dup Temp Major ATA Table Create].MajorID, [Dup Temp Major ATA Table Create].Model, [Dup Temp Major ATA Table Create].ATA, [Dup Temp Major ATA Table Create].Subject, [Dup Temp Major ATA Table Create].[Teach Time], [Dup Temp Major ATA Table Create].Chapter, [Dup Temp Major ATA Table Create].Comments, [Dup Temp Major ATA Table Create].Hours, [Dup Temp Major ATA Table Create].Minutes, [Dup Temp Major ATA Table Create].[Remove Ch], [Dup Temp Major ATA Table Create].[Remove Comments], [Dup Temp Major ATA Table Create].[Remove Time]"
FROM [Dup Temp Major ATA Table Create]
WHERE ((([Dup Temp Major ATA Table Create].MajorID)=[Forms]![Dup Major Adjust Form]![MajorID]));" CurrentDb.Execute strSql
Me.Requery
But the WHERE statement fails. I thought I was following the syntax we used yesterday.
Also, I am not sure I need to identify all the fields. When I click the check box...bound to the table...I want that record to be deleted from the table.
Please help again. And, yes, I know my table naming convention is bad..I am working on that.
Thanks,