Results 1 to 3 of 3

Thread: DB delete Error with VB !!

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Montreal
    Posts
    59

    Thumbs up

    Hello how do i delete a row with DAO ?
    i allway's get a error with this :
    any idea why ?

    Private Sub mnudel_Click()
    On Error GoTo 1:
    RS.Edit
    RS.Delete
    db.Recordsets.Refresh
    DbRefreshTextBox
    DbRefreshTextBox

    Exit Sub
    1:

    MsgBox Err.Description

  2. #2
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    Hello Zulander

    I don't know what the error is but it is better to use this line:

    if RS.RecordCount <> 0 then RS.Delete

    You don't need: RS.Edit

    Nice regards,

    Michelle.

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    RS.delete
    RS.update

    Don't use the rs.edit as Michelle mentioned & I think I'm right in putting the update instead of Refresh

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width