Results 1 to 3 of 3

Thread: Delete Multiple Records

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    13
    I have a small program that uses a .mdb database and have them connected with a data1 object. I have a command button on the form that is = to data1.recordset.addnew. If you click the add new button and add a new record then click it again to add another one. then click the data1.recordset.delete command button it will delete the current record and the original record you started on. I think I need some more code in the add command . I hope you can help me and that I am clear enough.
    Thanks Alot,

  2. #2
    New Member
    Join Date
    Feb 2000
    Posts
    10

    Talking

    recordset.Delete
    recordset.MoveFirst
    recordset.Delete
    data.Refresh

    or

    recordset.Delete
    recordset.Seek "=",the key of the record to be delete
    recordset.Delete
    data.Refresh

    Hope it helps

  3. #3
    Lively Member
    Join Date
    Jan 2000
    Location
    usa
    Posts
    100

    Cool

    I take it you want to delete multiple records...
    if so, then try this...

    code...

    Set rst = dbs.OpenRecordset("SELECT * FROM rst _
    WHERE rst.fieldname = '" & variable & "'", dbOpenDynaset)

    dbs.Execute "DELETE * FROM " _
    & "rst WHERE rst.fieldname = '" & variable & "'"


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