- Joined
- Oct 28, 2013
- Messages
- 3
- Reaction score
- 0
Good morning,
I am having a problem creating a DELETE SQL statment in MS Access 2007. What I need to do is delete a project record from entirely in several tables from a dashboard form. I have a "Delete Record" button that I put code to that should delete the current record, but seem to get a "Data MissType" error. Is there somthinf with using the "& that causes it to mess up. All of the field types are TEXT and it shouls work...
Delete command button:
DoCmd.RunSQL "DELETE FROM tblName WHERE [tblName.ProjectID] = " & Me.txtProjectID & ""
My thinking is to grab the project number from the current form's project field txtProjectID and use it in the criteria to delete the same numbered record from several tables. Once I get it to work on one table it should be the same for all and I will just run the DELETE statment agenst each table name...
Any help woill be greatly appreciated.
I am having a problem creating a DELETE SQL statment in MS Access 2007. What I need to do is delete a project record from entirely in several tables from a dashboard form. I have a "Delete Record" button that I put code to that should delete the current record, but seem to get a "Data MissType" error. Is there somthinf with using the "& that causes it to mess up. All of the field types are TEXT and it shouls work...
Delete command button:
DoCmd.RunSQL "DELETE FROM tblName WHERE [tblName.ProjectID] = " & Me.txtProjectID & ""
My thinking is to grab the project number from the current form's project field txtProjectID and use it in the criteria to delete the same numbered record from several tables. Once I get it to work on one table it should be the same for all and I will just run the DELETE statment agenst each table name...
Any help woill be greatly appreciated.