Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2011
    Posts
    30

    Unanswered: edit records in listbox

    I have two listboxes, listregistered and listattended, on my form. I select records from listregistered and move them to listattended. Once I have placed all the desired records in listattended, I want to be able to use a button that will update the attendance field in contacttable. The attendance field is a yes/no field. I would appreciate some direction on what code to use for the button. Thanks
    Last edited by crosseydlobster; 05-29-11 at 19:37.

  2. #2
    Join Date
    May 2010
    Posts
    601
    I would run an update query.

    You will need to use some VBA code to build the Where clause from the listbox.

    For an exmple see:
    Use a multi-select list box to filter a report
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  3. #3
    Join Date
    Apr 2011
    Posts
    30
    I looked at this and I don't believe this quite fits my situation. Maybe I just don't know what I am talking about.

    Once I have all the records I need in "listattended" then all i want to do is click a button that will change the yes/no field called "attendance" in the table called "contacttable" to yes for all the records in the listbox.

  4. #4
    Join Date
    May 2010
    Posts
    601
    There may be another way with a list box but I don't know of a better way that running an update query using a list box to create the Where clause.

    I use that wethod with great success.
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Tags for this Thread

Posting Permissions

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