Results 1 to 2 of 2
  1. #1
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291

    How do I get data from a listbox?

    I have a list box with;
    Name: lstPeople
    Row Source: SELECT People.PID, People.[First Name], People.[Middle Initial], People.[Last Name] FROM People;



    When I have an item selected in the list box I want to be able to push a button and get information from the selected person. This information is from the table People but the form I am on is unbound so I cant use current record or anything like that.

    So for example I have the 4th person selected and click a button that will be able to display that persons PID

    Thanks for any help

  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,521
    You can either use a technique like this to open a separate form:

    BaldyWeb wherecondition

    Or simply

    Msgbox Me.ListboxName.Column(x)

    where x is the column containing the desired info (zero based).
    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. Update form when data collected from Listbox
    By Evetsllub in forum Forms
    Replies: 1
    Last Post: 06-10-2010, 05:33 PM
  2. Horizontal listbox - ?
    By bane in forum Forms
    Replies: 3
    Last Post: 04-20-2010, 06:48 PM
  3. Listbox question
    By uaguy3005 in forum Access
    Replies: 1
    Last Post: 03-05-2010, 08:35 AM
  4. Columns in a Listbox
    By craigalaniz in forum Access
    Replies: 3
    Last Post: 01-07-2010, 01:11 PM
  5. Replies: 1
    Last Post: 04-09-2009, 09: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