Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Record Selected from ListBox

Status
Not open for further replies.

bill1856

Programmer
Sep 5, 2005
18
US
I have a form in which a user enters a name, address, dob, etc. into textboxes. Upon completion of one record, the user clicks a button which saves the info, populates a listbox on the same form with the just the name and dob, and then goes to a new record. What I want to know if there is anyway the user can click on a row of the list box and have the associated record populate the text boxes? A shortcut back to the record, without having to scroll through records...

Thank you for any help.
 
Is the form bound or unbound? If it is bound, you can use the after update event of the list box to set the filter of the form to the value of the list box.

Duane MS Access MVP
Now help me support United Cerebral Palsy
 
Howare ya bill1856 . . .

Try this in the [blue]AfterUpdate[/blue] event of the listbox:
Code:
[blue]   Dim Cri As String
   
   Cri = "[Name] = '" & Me![purple][b]ListboxName[/b][/purple].Column(0) & "'"
   Me.Recordset.FindFirst Cri[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks to both of you. TheAceMan1, your code works perfectly - I put it in the 'on double click' event of my list box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top