I have a Textbox that requires me to type a number and then click a button to find the related values. but now what i need it to do is if i type 3 numbers Ex."123" it will return all the numbers that are related to any record starting with "123". I'm not sure if it's possible. and i'm using the following code but when i run it it gives me a type missmatch.
Private Sub Command35_Click()
If IsNull(Me.Text22.Value) = True Then
MsgBox "You need to enter a reference number"
ElseIf IsNull(Me.Text22.Value) = False Then
Me.List28.RowSource = "SELECT dbo_Typesofmaterial.[MATERIAL NAME], dbo_Inventory.[REFF NUMBER], dbo_Whse.[NAME], dbo_Inventory.NO_IN, dbo_Inventory.[POSITION], dbo_Inventory.[PO NO], dbo_Inventory.[REF NO2], dbo_Suppliers.SUPPLIERID, dbo_Inventory.DATE, dbo_Inventory.MATTYPE FROM (dbo_OrderDetails INNER JOIN (((dbo_Inventory INNER JOIN dbo_PurchaseOrders ON dbo_Inventory.[PO NO] = dbo_PurchaseOrders.[PO NO]) INNER JOIN dbo_Suppliers ON dbo_PurchaseOrders.ID = dbo_Suppliers.ID) INNER JOIN dbo_Typesofmaterial ON dbo_Inventory.MATTYPE = dbo_Typesofaterial.ID) ON dbo_OrderDetails.[REFF NUMBER] = dbo_Inventory.[REFF NUMBER]) INNER JOIN dbo_Whse ON dbo_Inventory.[FINAL DESTN ] = dbo_Whse.[WHSE NO] WHERE (((dbo_Inventory.[REF NO2])= " * " & [Forms]![Ref No Locator]![Text22] & " * " ));"
Else
End If
End Sub