Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004

    Unanswered: Open a Form and Navigate to a Specific Item in a Listbox

    have a form frmEvaluation that opens from a search form

    on this form frmEvaluation is a listbox named lstAreas

    when I open the Form from the search form - I am setting a hidden textbox named txtEntryID to the EntryID from the Search form

    in the listbox, column (5) is the EntryID

    when I open the form frmEvaluation from the search form, I want to go to the Selection in the listbox that matches the EntryID I clicked from the search form


    areaname entryid
    area 1 100
    area2 101
    area3 102

    form with listbox

    Area 1
    Area 2
    Area 3

    so - if I click Area2 on the search form - I am opening frmEvaluation - and I want to go to Area2 on the listbox or navigate in the listbox to where entryid = entryid

    Any help is appreciated - Thanks! - AB

  2. #2
    Join Date
    Jan 2007
    California, USA
    Which column of this list box is the Bound column, or is this list box not bound? If EntryID is the bound column, all you need to do is set the list box equal to EntryID that you receive from the search form. If EntryID is not the bound column, then you will need to, with VBA, look at each entry in the listbox until you find the EntryID you are looking for, then set the list box equal to whatever the bound column is for the same row that you found the EntryID on.

    If the EntryID is NOT the bound column, then my suggestion would be to use the SQL from the RowSource property to create a query, do a DLookup for the EntryID from this query and have the DLookup return the value for the Bound column, then set the ListBox equal to this returned value.
    Hope this helps,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts