Hi and advanced thanks...
I am trying to set up a command button to delete a single record at a time from 3 tables. The Unique ID (below) is not the primary key but is populated across the tables when a new record is given a Unique ID. cbodelete refers to a combo box where a user can select a record (using the Unique ID) to delete. My code right now is:
Dim dbs As Database
Set dbs = CurrentDatabase
dbs.Execute "DELETE * FROM Tbl1Descriptive WHERE [Unique ID]=" + [Forms]![Delete Study]![cbodelete]
dbs.Execute "DELETE * FROM Tbl2tx details WHERE [Unique ID]=" + [Forms]![Delete Study]![cbodelete]
dbs.Execute "DELETE * FROM Tbl3endpoints WHERE [Unique ID]=" + [Forms]![Delete Study]![cbodelete]
This isn't working at all and gives an "oject required" error. When I tried WHERE Unique ID = cbodelete, I got a parameter error. Can anyone help steer me the right way?
Cluelessly,
Kate
I am trying to set up a command button to delete a single record at a time from 3 tables. The Unique ID (below) is not the primary key but is populated across the tables when a new record is given a Unique ID. cbodelete refers to a combo box where a user can select a record (using the Unique ID) to delete. My code right now is:
Dim dbs As Database
Set dbs = CurrentDatabase
dbs.Execute "DELETE * FROM Tbl1Descriptive WHERE [Unique ID]=" + [Forms]![Delete Study]![cbodelete]
dbs.Execute "DELETE * FROM Tbl2tx details WHERE [Unique ID]=" + [Forms]![Delete Study]![cbodelete]
dbs.Execute "DELETE * FROM Tbl3endpoints WHERE [Unique ID]=" + [Forms]![Delete Study]![cbodelete]
This isn't working at all and gives an "oject required" error. When I tried WHERE Unique ID = cbodelete, I got a parameter error. Can anyone help steer me the right way?
Cluelessly,
Kate