Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box lookup doesn't show all records

Status
Not open for further replies.

mrsmarwi

Technical User
Apr 16, 2008
1
US
Hi everyone,

I have a combo box on a form that I use as a lookup for client info, however when the list won't show me any records beyond W. I have pasted the code below. Also, the lookup uses the lastname field as the search criteria. Is there a way that I can use both lastname and firstname to search instead of having to scroll through the list? Thank you so much for any help you can give! This is my first big step into database design and I am just stumped with this one!


Private Sub NameLookUp_KeyUp(KeyCode As Integer, Shift As Integer)
'Dim x As Variant
'x = NameLookUp.Text
'namehold = x
'If Len(x) = 3 Then
' 'NameLookUp = Null
' 'NameLookUp.r
' 'NameLookUp.Requery
' NameLookUp.Dropdown
' ' NameLookUp.Text = x
'End If
End Sub


AFTER UPDATE:

Sub NameLookUp_AfterUpdate()
yep = 1
' Find the record that matches the control.
If IsNull(Me![NameLookUp].Column(6)) Then
DoCmd.GoToRecord , , acNewRec
[lastname] = [NameLookUp]
GoTo ex1
End If
Me.RecordsetClone.FindFirst "[ID] = " & Me![NameLookUp].Column(6)
Me.Bookmark = Me.RecordsetClone.Bookmark
ex1:
lastname.SetFocus
NameLookUp = Null
yep = 0
 
There is a limit to how many rows a ComboBox can display. See if this link helps at all:
RuralGuy (RG for short) aka Allan Bunch MS Access MVP acXP winXP Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top