Results 1 to 2 of 2
  1. #1
    UserX is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2014
    Posts
    30

    **PBaldy** Update Record in Listbox

    Pbaldy,



    I used your suggestion from this post: https://www.accessforums.net/showthr...6&goto=newpost and the suggestion is coming along nicely; however, I have one minor problem, and I was hoping you could help me solve this.

    Take a look at my attached sample; the Sign-in Log form. What I'm trying to accomplish is a way to edit/update a selected record to be able to add in a time value for the "TimeHelped" column in the listbox, while using the Form View. I tried to use a text box with the "rs.Edit" command, instead of "rs.AddNew" (like you did with your sample MultiSelectAppend db's "Other value" box), but this returns an error "No current record."

    Do you have any suggestions on how I might accomplish this?

    Things I've tried:

    1. Split Form - only shows the TimeHelped box in the form and table
    2. Text box - as mentioned above
    3. Changed Row Source Type to "Value List" - This results in the records in the table no longer visible, and the column headers show, verbatim, the characters in the Row Source filed ([sign_in].[LastName]...)
    4. Attempted to make a subform, but for some reason I can't explain, this function is unavailable, as the button that enables/creates remains grayed out, even with a completely blank and unbound form
    Attached Files Attached Files

  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,652
    Untested but try replacing this line:

    Set rs = db.OpenRecordset("sign_in", dbOpenDynaset, dbAppendOnly)

    with:

    strSQL = "SELECT * FROM sign_in WHERE ID = " & ctl.ItemData(0, varItem)
    Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)

    but put them right after the For line.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. pbaldy - Multi-Select Listbox
    By jasbrown in forum Forms
    Replies: 9
    Last Post: 01-31-2013, 11:22 AM
  2. Replies: 2
    Last Post: 12-21-2012, 01:57 PM
  3. Replies: 1
    Last Post: 09-10-2012, 11:21 PM
  4. Replies: 22
    Last Post: 06-12-2012, 10:02 PM
  5. OpenArgs problems - FAO pbaldy/ruralguy
    By l3111 in forum Forms
    Replies: 22
    Last Post: 06-06-2011, 08:46 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