I want to be able to locate a specific record in a table by filtering the records using an input box on the form. If the complete description in the order field is 100073856, I need to be able to select the record by entering only 7385. The code I have constructed thus far works only if I enter the full description. How would I modify the criteria statement to get it to work ?
Private Sub LocateOrder_Click()
If Me.FilterOn Then
Me.FilterOn = False
LocateOrder.ForeColor = 0
Exit Sub
End If
Dim Answer As String
Answer = InputBox("Order:", "Filter By Item", Default)
If IsNull(Answer) Then
Exit Sub
End If
Dim criteria As String
criteria = "[Order] Like '" & Answer & " *'"
Me.Filter = criteria
Me.FilterOn = True
LocateOrder.ForeColor = 255
End Sub
Private Sub LocateOrder_Click()
If Me.FilterOn Then
Me.FilterOn = False
LocateOrder.ForeColor = 0
Exit Sub
End If
Dim Answer As String
Answer = InputBox("Order:", "Filter By Item", Default)
If IsNull(Answer) Then
Exit Sub
End If
Dim criteria As String
criteria = "[Order] Like '" & Answer & " *'"
Me.Filter = criteria
Me.FilterOn = True
LocateOrder.ForeColor = 255
End Sub