Results 1 to 3 of 3
  1. #1
    Exl2Acc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    2

    Editing records using a listbox

    Greetings ~

    I am currently duplicating in Access a program I wrote in Excel.

    One of the features in the Excel program is that users can select an item from a combobox click 'go' and the resulting filtered data is loaded into a listbox



    The user can then select one of the records in the listbox, then select an item from a combobox to edit that record.

    Let's say the record selected in the listbox showed 'Unapproved' in the field labeled 'Status'.

    If the user selected 'Approved' in the combobox then clicked the Edit button it would find the selected record in the Excel database and change that attribute from 'Unapproved' to 'Approved'

    I am able to load my records into the listbox using many filters, now I am wondering how to allow users to select and edit the record like they can in my Excel program

    Thank You in advance

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Presuming the listbox is single-select and the bound column is an ID field, something like:

    Code:
    Dim strSQL As String
    strSQL = "UPDATE TableName SET FieldName = '" & Me.ComboboxName & "' WHERE IDField = " & Me.ListboxName
    CurrentDb.Execute strSQL, dbFailOnError
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I thinking you'd have to requery the listbox afterwards?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 04-25-2017, 07:31 PM
  2. Transfer records from listbox 1 to listbox 2 gone wrong
    By Pommetje77 in forum Programming
    Replies: 6
    Last Post: 11-08-2016, 04:36 AM
  3. Editing a column in a ListBox
    By kspabo in forum Forms
    Replies: 4
    Last Post: 08-22-2014, 04:26 PM
  4. Editing a record - reselected values in listbox
    By teamcooper in forum Programming
    Replies: 5
    Last Post: 07-25-2014, 09:38 AM
  5. Replies: 17
    Last Post: 11-24-2011, 03:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums