Opening a Specific Record through a list box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My DB has a single form that allows users to input contact information. I
have a list box populated through a query of all of the people in the
database. I would like to be able to select one of the people in the list box
and then that person's information would load in the form so I can edit the
information if need be. How would I go about doing this. Listed below is the
names of the form and list box....

Form = Addresses
List Box = CompanyPersonelListBox

The list box is sorted by the last name in ascending order.

Thanks for any help provided
 
SGT said:
My DB has a single form that allows users to input contact information. I
have a list box populated through a query of all of the people in the
database. I would like to be able to select one of the people in the list box
and then that person's information would load in the form so I can edit the
information if need be. How would I go about doing this. Listed below is the
names of the form and list box....

Form = Addresses
List Box = CompanyPersonelListBox

The list box is sorted by the last name in ascending order.


Because of its AutoComplete feature, I recommend a xombo boc
instead of a list box. Either way, the box needs its
BoundCoumn to be the person table's primary key field.

Then you can use the box's AfterUpdate event to construct
the form's RecordSource SQL statement. THe code would be
like:

Me.RecordSource = "SELECT * FROM people " _
"WHERE [pk field] = " & Me.thebox
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top