Results 1 to 6 of 6
  1. #1
    teamcooper is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2014
    Posts
    6

    Editing a record - reselected values in listbox

    Hello! I am working on a form that edits a record. How do I tell the list box to mark the saved values as selected when editing the record?



    ie for this record the user has saved the following values in the listbox

    Monday;Tuesday;Friday

    How do I get the listbox to do this when editing the record:

    Monday (selected)
    Tuesday (selected)
    Wednesday
    Thursday
    Friday (selected)

    Forgive me if I have either over or under-explained.

    Sincere thanks in advance!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Items within the listbox control's collection are referenced by their index, starting with 0 if IIRC.

    So something like this (untested)
    Me!ListboxName.Selected(5) = True

  3. #3
    teamcooper is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2014
    Posts
    6
    Thanks ItsMe! That helps a great deal.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Sure thing.

    I just remembered, I posted some code here that may also be helpful.
    https://www.accessforums.net/code-re...box-43002.html

  5. #5
    teamcooper is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2014
    Posts
    6
    Did the trick! Thanks so much!

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You bet....

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

Similar Threads

  1. Replies: 5
    Last Post: 12-03-2013, 02:06 PM
  2. Replies: 3
    Last Post: 12-13-2012, 01:09 PM
  3. Replies: 1
    Last Post: 09-10-2012, 11:21 PM
  4. Replies: 17
    Last Post: 11-24-2011, 03:37 AM
  5. duplicating and editing the record
    By Airis in forum Forms
    Replies: 1
    Last Post: 04-12-2010, 07:41 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