Private Sub CmdSearch_Click()
Dim SrchStr As String, _
found As Variant
blnNew = False
txtPartDescription.Text = ""
txtSpecifications.Text = ""
txtPartNumber.Text = ""
txtQuantity.Text = ""
txtCompany.Text = ""
txtTSIPO.Text = ""
txtOracle.Text = ""
SrchStr = ComboBox1.Value
With Worksheets("Infeed Conveyor")
TRows = .Range("A1").CurrentRegion.Rows.Count
With .Range("A1:A" & TRows)
Set found = .Find(SrchStr)
If Not found Is Nothing Then
With found
txtPartDescription.Text = .Value
txtCompany.Text = .Offset(0, 1).Value
txtPartNumber.Text = .Offset(0, 2).Value
txtSpecifications.Text = .Offset(0, 3).Value
txtQuantity.Text = .Offset(0, 4).Value
txtTSIPO.Text = .Offset(0, 5).Value
txtOracle.Text = .Offset(0, 6).Value
End With 'copy data
End If 'found the val
End With 'col A search
End With 'sheet
If Trim(txtPartDescription.Text) = "" Then
cmdSave.Enabled = False
cmdDelete.Enabled = False
Frame2.Enabled = False
Else
cmdSave.Enabled = True
cmdDelete.Enabled = True
Frame2.Enabled = True
End If
End Sub
Bookmarks