Dear all,
Im sure this is so simple and I am just missing the point. I have created a form that contains a list of items in a listbox. I have been able to write the code to add new items to the listbox and update the list box - Simple.
However Im having trouble deleting the item from the SQL database. I am able to find the correct record in the list box and then I dont seem to be able to remove it from the SQL db. I have:
Do While Not CatagoryRS.EOF
If CatagoryRS![Catagory] = LstCatagories.Text Then
CatagoryRS.Delete
CatagoryRS.MoveLast
Else
CatagoryRS.MoveNext
End If
Loop
CatagoryRS.Update
CatagoryRS.Close
Can someone please point of the stupid mistake.
Many thanks
Im sure this is so simple and I am just missing the point. I have created a form that contains a list of items in a listbox. I have been able to write the code to add new items to the listbox and update the list box - Simple.
However Im having trouble deleting the item from the SQL database. I am able to find the correct record in the list box and then I dont seem to be able to remove it from the SQL db. I have:
Do While Not CatagoryRS.EOF
If CatagoryRS![Catagory] = LstCatagories.Text Then
CatagoryRS.Delete
CatagoryRS.MoveLast
Else
CatagoryRS.MoveNext
End If
Loop
CatagoryRS.Update
CatagoryRS.Close
Can someone please point of the stupid mistake.
Many thanks