I have a simple Access database that has image pathways identified by part numbers. Right now people can enter the part number manually but I want them to be able to scan a barcode that enters the part number. Unfortunately, the barcode contains additional content other than the part number.
For example: 79|99999-ID|Lot:9999|Exp:31-June-1999
Should be trimmed down to "99999-ID".
Option Explicit
Private Sub BTN_Search_Click()
Dim SQL As String
SQL = "SELECT Query65.ITEM_NUMBER, Query65.PLANNER_DESCRIPTION " _
& "From Query65 " _
& "WHERE [ITEM_NUMBER] = '" & Me.txtPartNumber & "' " _
& "ORDER BY Query65.ITEM_NUMBER "
Me.SubPlannerSubForm.Form.RecordSource = SQL
Me.SubPlannerSubForm.Form.Requery
End Sub```