Combobox trouble

T

Tom R.

Hello!
I've made a combobox to search for people in a form. It works, in a way, but
not totally. It sorts by Lastname, but I can also se the persons first name
in the combo.
The trouble is that if there are more people with the same lastname, the
combo gives me the first name Anderson, Anne instead of the name Anderson,
Dave, who I really wantet to see in the form.

How can I solve this problem?

Code from the combo: (Etternavn is Lastname in Norwegian =) )
Private Sub Combo62_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Etternavn]= '" & Me![Combo62] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
 
T

Tom R.

I think I shorted it out my self.
I just added the ID field that is uniqe and then it was solved.
 

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

Similar Threads

Error 2147352567 2
recordset.clone 13
Combo Box Updates, but Form/Data Doesn't 13
Recordset Clone using Autonumber 3
RunTime Error 3070 8
Add if not in combo box 10
Search combo box 2
Combo Box Error 3077 - Access 2003 1

Top