Dear Experts,

Has anyone could help me please to fix this code...it always failed I tried many time?...This is a "Delete" button, when I press this button, it should be delete row/item on the database...but it always failed....here is the code:

VB Code:
  1. Private Sub CommandButton3_Click()
  2.  
  3.  Dim con As ADODB.Connection
  4.     Set con = New ADODB.Connection
  5.     con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\exercise.mdb"
  6.    
  7.     Set rst = Execute_SQL_ReturnRecordSet("Select * from Item", False, "C:\exercise.mdb")
  8.    
  9.          rst.MoveFirst
  10. Do While rst.EOF = False
  11.     If UserForm1.txtqty.Text = rst.Fields("Item_Code").Value Then
  12.        Exit Do
  13.     End If
  14.     rst.MoveNext
  15. Loop
  16.  
  17.     TextBox3.Text = rst.Fields("Qty")
  18.        
  19.     Application.ScreenRefresh
  20. End Sub

When I select item no 1 (using a combo box), then when I press "Check Current Stock" it show its Qty which is "1"...BUT, when I select other item numbers, let say item code number 3 it still show the Qty for item number 1...???....

Please help with code corrections...

Thank you so much...

Jennifer