List Box in Contact Details

N

New to Access '07

I am using Access 2007 and created a list box for my contacts under Contact
Details. When I use the list box to select a different contact, I would like
the screen to switch over that person's information. So far, all I have is
the list box, but I am not being directed to a new details screen for the
next person. Please HELP.
 
D

Damon Heron

I would recommend a combo box instead of a listbox - you can type in the
first few characters of your contact and find it easier. Set your record
source on the form to the table with the contacts.

In the afterupdate event of the combobox (which I call cboFind):

Private Sub cboFind_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ContactID] = " & str(Nz(Me![cboFind], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub

Damon
 

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

Top