I tried to write a code but it doesn't seem to be working. Here's it.
Private Sub ButtonDelete_Click()
Dim strSQL As String
strSQL = "DELETE TOP " & Me.regNumber & " FROM data WHERE [Product ID] = Me.ProductID"
Exit Sub
DoCmd.RunSQL "strSQL"
End Sub
Having the code would be much appreciated. I'm mot entirely sure how to write the code. And as for the "r = Me.txtbox2 - 1", one extra record is produced when i used this code to add records so i added a -1 to fix it. No idea why it does that. :p
I use a count of the id's in the table to see...
Hello, i'm pretty new to access and vba and i cant seem to get my code to work. The code is meant to delete a specific (r) number of rows from a table. Rows are deleted based on a criteria if the item id entered in a text box matches the item id in a field in the table. (there are many records...