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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a form with items in list box

Status
Not open for further replies.

interviewer

Programmer
Aug 24, 2006
1
US
Hi,
I have a list box with data from a table. Eg. Firstname, lastname, phone# displayed in my listbox in a form.
Now when the list is displayed, I would like to double click an item in that list, which should open a new form with all the information from the same table, but for that item only. eg. if I lick on Jone Doe, 999-999-9999 its should open a different from with more details only about Jone Doe. How can I do it. Help is much appreciated.
Thank you,
-Layman.
 
Your first step should be creating that specific table with all the records linked and then creating that form based on a query that will go and read the information you have selected in your listbox.

"Knowing that you know is the greatest sign of stupidity, knowing that you are ignorant is the best proof of intelligence.
 
Hi!

Make sure that the ID field is the bound colum of the list box and the list box cannot be multiselect. In the DoubleClick event of the list use:

DoCmd.OpenForm "YourDetailForm", , , , "YourIDField = '" & Me.YourListBox.Value & "'"

This assumes that the ID field is text since you indicated that it was in the form 999-999-9999, if it is a numerical field leave out the single quotes.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top