Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete all chosen items (Access 2000)

    I want to delete all the items i have chosen in a form,but i manage to delete only the first item. How can i delete all items chosen in the form?
    For example in my form frm1 i have chose to delete the items 2,3 and 4.
    However,if i click the button, only the first item will be deleted.
    How can i change my code so as to delete all the items?

    Dim CL As String
    CL = Me!ClientID
    Bas = " delete * from tblClients where Clientid = " & CL
    CurrentDb.Execute Bas

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete all chosen items (Access 2000)

    You can select only one record at a time in the form, so it doesn't make sense to delete more than one.

    If you want to be able to delete multiple records, you could use an unbound form with a multi-select list box.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete all chosen items (Access 2000)

    Could i use then an update query instead? Actually i want to delete all the clients in the table TblClients that exist ( are present)
    in the table TblTemps.That is the purpose of the table TblTemps, to show which clients are to be deleted

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete all chosen items (Access 2000)

    No, an update query is meant to modify records. To delete records, you can use a delete query.

Posting Permissions

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