I have this code (and it works OK):
And once it runs through, the macro to perform a search of whatever is inserted to that textbox fires off just fine.
But I'd really prefer a way to simply have the MsgBox go away and the trim and concatenate fire off as soon as I put the search term in the textbox. Any thoughts?
Code:
Private Sub TextBox1_GotFocus()
searchTerm = InputBox("Enter your ticket number here.")
If Trim(Left((searchTerm), 3)) = "PKE" Then
TextBox1.Value = "PKE000000" & Right((searchTerm), 6)
Else
TextBox1.Value = "PBI000000" & Right((searchTerm), 6)
End If
End Sub
And once it runs through, the macro to perform a search of whatever is inserted to that textbox fires off just fine.
But I'd really prefer a way to simply have the MsgBox go away and the trim and concatenate fire off as soon as I put the search term in the textbox. Any thoughts?