Problem with delete record
Hi,
I have a database (DAO) that has two tables - Users (Fields are User ID, and Password), and Categories (Fields are UserID, Category, and SubCategory).
The following is the code I use to delete a Category...
Private Sub cmdCatDelete_Click()
Set db = OpenDatabase(App.Path + "\" + "mydb.mdb")
Set rs = db.OpenRecordset("SELECT Categories.Category From Categories WHERE Categories.Category = " + Chr$(34) + cmbCategory.Text + Chr$(34) + ";")
rs.MoveFirst
Do Until rs.EOF
With rs
.Delete
End With
rs.MoveNext
Loop
db.Close
End sub
This works fine except that if two differrent users have named a category the same name, it deletes the other users category also.
How can I delete just the category of the user that is logged in?
I hope I explained this well enough, and I appreciate any help I can get on this.
Thanks,
Ron