Bound True Grid dont refresh after delete

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    Bound True Grid dont refresh after delete

    I'm having a problem with the grid not getting refreshed after
    deleting a record. Even though the record is deleted from the table. I
    have the following code in a Delete button event:
    sql = "Delete from OrderDetails where Orderid = " &
    datOrderItems.R ecordset!OrderI d
    sql = sql & " and ProductId = '" &
    datOrderItems.R ecordset!Produc tId & "'"
    gconn.Execute sql
    datOrderItems.R ecordset.Requer y
    datOrderItems.R ecordset.MoveNe xt
    If datOrderItems.R ecordset.EOF Then
    datOrderItems.R ecordset.MoveLa st
    End If
    datOrderItems.R ecordset.Filter = "Orderid = " &
    cmbOrders.Colum ns.Item(0).Text
    grdOrderDetails .ReBind

    Why does the row that was deleted still show in the grid after the
    delete. If I change the filter on the recordset, it will display the
    new results, but when I come back to the old Order#, the same contents
    will display, even the deleted record. If I close the form and load it
    again, the record gone. What the heck is going on. Please help.
    Thanks Michael
Working...