Results 1 to 4 of 4
  1. #1
    dadas is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    4

    listbox code

    list box code....


    i have 2 list boxes...list91 & List93
    I want to have it so if u select a the first item in list91 it automatically selects the first item in list93, if u select the second item it selects the 2nd item, if u select the third...u get the point...is there vba code i can use for this?

    also is there a way to make it so u can scroll to the right in a list box....all my items are small exept for a few, and i dont want to have a giant list box so ide liek to give the option to scroll to the side to read certain ones. THANKKKSSSS

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,643
    Try:
    N = Me.Listbox1.SelectedIndex
    Me.Listbox2.Selected(N) = True

    Apparently the horizontal scroll bar will automatically show if the listbox is set for multi-column. Even then not able to scroll far enough to see all of last column. Never thought much about this. Always sized listboxes to fit and don't use them much anyway. Not seeing horizontal scroll bar with a single column.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dadas is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    4
    thanks dude, u helped alot the only thing i changed is i used the listindex. because selectedindex doesnt work in access...thanks!!!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,643
    Glad you figured it out. Sorry I grabbed the wrong property from my search.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Listbox
    By mikejames in forum Forms
    Replies: 1
    Last Post: 10-25-2011, 07:53 AM
  2. listbox help
    By imintrouble in forum Access
    Replies: 2
    Last Post: 10-20-2011, 01:53 PM
  3. Need Multi-Select listbox code example
    By Buakaw in forum Forms
    Replies: 4
    Last Post: 08-21-2011, 08:37 PM
  4. Word code in Access - How to modify my current code
    By Alexandre Cote in forum Programming
    Replies: 0
    Last Post: 11-15-2010, 08:26 AM
  5. Code in combobox, code in text box
    By float in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:12 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