Go to duplicate name in search field

G

Guest

Hello,

The following code works to find a last name in a combo box, then jumps to
the last name and other information within the form. When there is a
duplicate last name in the combo box, it will only jump to one entry/name.
Other information is unique, only the last name is the same. I need it to
jump to each identified entry/name, no matter.

Can someone help me out?

Private Sub MomLastFind_AfterUpdate()

Me.Requery
MomLastFind.Requery

'Move to the record selected in the control
Me.RecordsetClone.FindFirst "[MOMLAST] = '" & Me![MomLastFind] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
MOMLAST.SetFocus
End Sub
 
A

Al Camp

Newbie,
Your LastName field is not "unique" enough to find the exact record you
want. You should be locating your records using a key field value, not Last
Name. Each of your records should have a unique key field, usually an
AutoNumber field that assigns a unque number to every New record you create.
Use that field to find the specific person. You can still select the
record to find by LastName/FirstName, but the find should use that person's
key field value to Find the exact record.
hth
Al Camp
 

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