Search Combo Box Acting Wrong

P

Philippe Perrault

I have an unbound combo box in the header of my form for users to use to
search for records. The input it is looking for is the last name. In this
particular instance the user typed "Williamson" and there are four records
with the last name Williamson. The search went to the first of the four
records. When the user selected the third record, instead of going to that
record the form remained focused on that first record as long as the last
name of the person being selected was Williamson. Pick another last name and
it moved the focus of the form to that record. I got the same results this
user got on his computer from my computer. I tried to delete the Combo box
and recreate it (with the wizard) and still got the same result. Any ideas
on why it would do this what can be done to correct it.
 
P

Philippe Perrault

Jeff Boyce said:
Philippe

What is the SQL statement you are using to "feed" the combo box?

SELECT [2-5FA Form Data].[Last Name], [2-5FA Form Data].[First Name],
Rank.Rank
FROM Rank INNER JOIN [2-5FA Form Data] ON Rank.RankID = [2-5FA Form
Data].RankID
ORDER BY [2-5FA Form Data].[Last Name];
What is the AfterUpdate expression you are using to load the record?

I am not sure where to go to find this?
What is the source expression you are using for the form?

SELECT [214 FIB Alpha Roster].UnitsID, [214 FIB Alpha Roster].PARNO, [214
FIB Alpha Roster].LN, [214 FIB Alpha Roster].[Last Name], [214 FIB Alpha
Roster].[First Name], [214 FIB Alpha Roster].[Middle Initial], [214 FIB Alpha
Roster].SSN, [214 FIB Alpha Roster].MTOERankID, [214 FIB Alpha
Roster].PMOSID, [214 FIB Alpha Roster].Gender, [214 FIB Alpha Roster].[Loss
Date], [214 FIB Alpha Roster].DOR, [214 FIB Alpha Roster].DOB, [214 FIB Alpha
Roster].[Date Arrived Ft Sill], [214 FIB Alpha Roster].[Date Assigned], [214
FIB Alpha Roster].[Date Returned Deployed], [214 FIB Alpha Roster].[Deployed
Date], [214 FIB Alpha Roster].ReasonID, [214 FIB Alpha Roster].RankID, [214
FIB Alpha Roster].RaceID, [214 FIB Alpha Roster].USRID, [214 FIB Alpha
Roster].Remarks, [214 FIB Alpha Roster].MOSQ, [214 FIB Alpha Roster].Married,
[214 FIB Alpha Roster].[Battle Roster Number]
FROM [214 FIB Alpha Roster]
WHERE ((([214 FIB Alpha Roster].UnitsID)=3 Or ([214 FIB Alpha
Roster].UnitsID)=7 Or ([214 FIB Alpha Roster].UnitsID)=12 Or ([214 FIB Alpha
Roster].UnitsID)=21 Or ([214 FIB Alpha Roster].UnitsID)=22 Or ([214 FIB Alpha
Roster].UnitsID)=23 Or ([214 FIB Alpha Roster].UnitsID)=24));
 
P

Philippe Perrault

Jeff Boyce said:
Philippe

What is the SQL statement you are using to "feed" the combo box?

What is the AfterUpdate expression you are using to load the record?

Never mind. Found it.

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[Last Name] = '" & Me![Combo55] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[First Name] = '" & Me![Combo57] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
 
J

Jeff Boyce

Your AfterUpdate code uses a FindFirst ... which one were you finding?<g>

Regards

Jeff Boyce
Microsoft Office/Access MVP

Philippe Perrault said:
Jeff Boyce said:
Philippe

What is the SQL statement you are using to "feed" the combo box?

What is the AfterUpdate expression you are using to load the record?

Never mind. Found it.

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[Last Name] = '" & Me![Combo55] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[First Name] = '" & Me![Combo57] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
What is the source expression you are using for the form?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

message news:[email protected]... name
and Combo
box
 
Top