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
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