Although you select a 'second' person in the combobox, your code is finding
the first occurrence of the selection (in the rst.FindFirst "[LastName] = '"
& Me.Combo73 & "'" ) line. For it to work the way (I think) you want, you
need to have the combobox bound to a unique field in your recordset, and
search for that. Your combobox does not have to display the unique field
(eg. PersonID); you can simply set the column width for that field to 0.
So, for example, if your combobox has a row source of:
SELECT PersonID, LastName, FirstName FROM tblPeople ORDER BY LastName,
FirstName
and is bound to Column 1, you can display only the name fields by setting
the Column Count to 3 and the Column Width to 0cm;5cm;5cm. Then if you
change your code to:
...
rst.FindFirst "[PersonID] = '" & Me.Combo73 & "'"
...
it will work as you expect. Note that if PersonID is numeric you will not
need the single quote delimiters; they are only required if PersonID is a
text field.
The code in the Form_Current event will need to reflect this change:
Me!Combo73 = Me!PersonID
And, of course, the form's recordsource must include the unique field (in
this example, PersonID).
HTH,
Rob
> Can anyone see why when I select a 'second' person with the same
> lastname...why the form below doesn't change...however it does when I select
[quoted text clipped - 13 lines]
> Me!Combo73 = Me!LastName
> End Sub
Barry Moses - 09 Nov 2005 10:48 GMT
Thank you, thank you, thank you!!!!
> Although you select a 'second' person in the combobox, your code is
> finding
[quoted text clipped - 46 lines]
>> Me!Combo73 = Me!LastName
>> End Sub