I want to capture the correct displayed combo box data see the screen shoot below"
How do I do it , I can tell you I have worked so hard to reach at this point in terms of filtering a combox in Ms Access all I need now is to capture the correct data in the combo box . Example the firstname must be inserted in the combo box not last name
VBA code I'm using:
Sample database is also attached , I will highly appreciated your assistance in resolving this issue , I think I'm almost there.
How do I do it , I can tell you I have worked so hard to reach at this point in terms of filtering a combox in Ms Access all I need now is to capture the correct data in the combo box . Example the firstname must be inserted in the combo box not last name
VBA code I'm using:
Code:
Option Compare Database
Option Explicit
Private Sub EmployeeID_Change()
Dim rstBig As ADODB.Recordset
Dim rstFilter As ADODB.Recordset
Dim strPerm As String
'With each valid change the combo is requeried against the table source.
'A data hit with each keypress
Dim intLen As Integer
intLen = Val(Nz(Me.txtReq))
If Len(Me.EmployeeID.Text) >= intLen Then
Me.EmployeeID.RowSource = "SELECT FirstName,LastName FROM tblEmployees WHERE FirstName Like '" & Me.EmployeeID.Text & "*'"
If Me.EmployeeID.ListCount > 0 Then
Me.EmployeeID.Dropdown
End If
ElseIf Len(Me.EmployeeID.Text) < intLen Then
Me.EmployeeID.RowSource = ""
End If
End Sub
Private Sub Form_Current()
Me.txtReq = 3
End Sub
Sample database is also attached , I will highly appreciated your assistance in resolving this issue , I think I'm almost there.