Results 1 to 10 of 10
  1. #1
    Bsamms is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    5

    Question Access 2010 Listbox search

    I am very new to Access... I am in the process of attempting a database to hold my passwords. I have prepared a table and corresponding form with on the lefthand side a listbox to contain an alphabetical list of the entries. I would wish to click on the subject in the listbox to display full details within the form. My problem is how do I make the connection.



    Any help would be appreciated in the simplest of terms. If any code is required could this be illustrated?

    A screen shot is attached.

  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
    Your simplest solution would probably be to use the combo or listbox wizard and choose the third option, "Find a record...".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Bsamms is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    5

    Access 2010 Listbox search

    Paul,

    Many thanks for your response.

    I am using Access 2010 and having created a ListBox using the wizard I cannot see that there is an option of "Find a record...." Could I ask you to clarify?

    Thanks
    Brian Samms

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The form needs to be bound to a table to see the third option; is it? If not, this is the type of code it creates (though in 2010 it would create an embedded macro):

    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[FieldName] = " & Me.ControlName
    Me.Bookmark = rs.Bookmark
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Bsamms is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    5
    Thanks again Paul,

    I am reasonably certain that the Form is bound to the only available Table.

    Whilst my very limited knowledge extends to creating tables and associated forms it goes no further.

    I remain at a complete loss how to show data in Form view from a field name contained in a ListBox.

    Can you give me a step by step guidance or point me to a tutorial to illustrate in very simple terms?

    Thanks again for ongoing interest.

    Brian Samms

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Bsamms is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    5

    ListBoxes

    Paul

    Herewith


    Regards
    Brian Samms

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The form is bound to a query, not the table directly.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Bsamms is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    5

    ListBox

    Paul

    Bound form to table but makes no difference.

    Me thinks will have to abandon concept and manually search with preconfigered "find button".

    Thanks for your interest.

    Regards
    Brian Samms

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Really? I switched it to be bound to the table, then ran the listbox wizard and the third option showed up as expected. I'm just on a iPad right now, but later I'll be on a pc and will get you the exact code.
    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. Listbox search
    By j9070749 in forum Programming
    Replies: 5
    Last Post: 11-29-2011, 03:20 AM
  2. Creating a dynamic search box in Access 2010
    By bob500000 in forum Access
    Replies: 1
    Last Post: 11-24-2011, 02:27 PM
  3. Replies: 1
    Last Post: 09-28-2011, 01:24 PM
  4. Unable to search record in my listbox
    By mar_t in forum Access
    Replies: 7
    Last Post: 07-27-2011, 07:37 PM
  5. Access 2010 - search query not working
    By beetgirl in forum Access
    Replies: 6
    Last Post: 07-12-2011, 09:56 PM

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