I have been trying to use this code to enable the type ahead function in a combo box within a form that I am using. The combo box contains the id#, old compound number and new compound number. What is the simplest way to enable the type ahead function?
This is the code I am using:
This is my first time writing code and using Access. The easier the better.
Any assistance will be appreciated.
Thanks
This is the code I am using:
Code:
Private Sub cboCompound_Number_Change()
Dim strTyped As String
Dim strSelect As String
strTyped = Nz(cboCompoundNumber.Text, "")
If Len(strTyped) = 3 Then
strSelect = "SELECT CompoundList.ID, NewPMXCompoundNumber, OldPMXCompoundNumber FROM CompoundList " & _
"WHERE CompoundNumber LIKE """ & strTyped & "*"" " & _
"ORDER BY CompoundNumber;"
cboCompoundNumber.RowSource = strSelect
End If
End Sub
Any assistance will be appreciated.
Thanks
Comment