Combo box to find record on form not unique

Steve_b

Registered User.
Local time
Today, 12:09
Joined
Sep 30, 2012
Messages
18
Hi All:

I am always amazed at the little things that hang me up when developing. I have a simple form and I used the combo box wizard to create combo box to search for records underlying the form. I have tried very idea I can think of to make the resulting drop down list unique. The wizard insists on building the query using the primary key along with one field I want to be unique so I understand why I am getting duplicates. When I remove the primary key from the query no records result. I am using Access 2010. While I am working on some more sophisticated pieces of the application with success I am stumped by this issue. Any insight would be appreciated.
 
Perhaps creating a new table holding the unique values and not using an existing table.
 
SOLVED Re: Combo box to find record on form not unique

Did something similar. I created a query that works to populate the combo box then used the following code in the after update event. Found this code in an older project of mine.

Code:
Private Sub cmbFind_AfterUpdate()

 Dim strCriteria As String

strCriteria = "[club_name] ='" & Me.cmbfind & "'"

Me.RecordsetClone.FindFirst (strCriteria)
If Me.RecordsetClone.NoMatch Then
    MsgBox "No entry found"
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
  End Sub
 

Users who are viewing this thread

Back
Top Bottom