Results 1 to 4 of 4
  1. #1
    rickscr is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    21

    Multiple default values in listbox

    I have a listbox in a form that is populated with values from a table. I want to have several of the values selected by default.

    Any idea how I can do this?

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    how about using the ".selected" property of the box and iterating through them?? first thing though would be changing the type of box from 'single' to 'multiple' or 'extended'.

  3. #3
    rickscr is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    21
    Here's what I tried:
    Code:
    lstMethods.Selected (1)
    lstMethods.Selected (3)
    lstMethods.Selected (5)
    It seems like the Default Value property in the Data tab would be the way to go, but I can't figure it out for a listbox.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    this works fine:

    Code:
    Me.List4.Selected(0) = True
    Me.List4.Selected(1) = True
    
    'etc, etc...
    ".selected" has to be assigned a boolean

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

Similar Threads

  1. option group default values
    By wlumpkin in forum Access
    Replies: 3
    Last Post: 02-15-2011, 03:30 PM
  2. option group default values
    By wlumpkin in forum Access
    Replies: 6
    Last Post: 02-07-2011, 06:07 PM
  3. Replies: 1
    Last Post: 03-24-2010, 08:42 AM
  4. Setting default values in columns
    By crownedzero in forum Programming
    Replies: 0
    Last Post: 06-17-2009, 06:45 AM
  5. Default Values
    By twainscott in forum Programming
    Replies: 0
    Last Post: 09-14-2006, 11:18 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