What do I have to do to delete a selected value in a ComboBox from a previous saved table?? I don't know how to search for the value on the table and delete it...
The traditional method of searching for a deleting a record in DAO is as follows:
Sub DeleteTheBugger()
Dim DB as database
Dim rst as recordset
Set DB = CurrentDb
Set rst = DB.OpenRecordset("Your table name"
With rst
.Index = "Name of table field that holds the cboValue"
'The field in the table MUST be indexed
.Seek "=", Me!cboNameOfComboBox
If not .NoMatch then
.Delete
End if
.Close
End with
End Sub
This routine will delete the first record in the table that matches the value in the combo box. A query, on the other hand, will delete ALL records in the table that match the value in the combo box.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.