Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,066
- Office Version
- 2016
- Platform
- Windows
I have this piece of code that allows a customer record to be searched via surname and then it displays the name in a textbox. so if the customers name was John Smith I need to type in Smith and click the find button on the useform and it will display it as Smith John, the search bit is fine and I have no issue with the name being back to front.
I want the range to include more information, currently the surname is in column 2 and the info for column 2 + 3 are only displayed. I want the info for column 1 to 9 to be displayed in the textbox.
Private Sub cmdFind_Click()
Dim SearchItem As String
Dim Error
If (tbFindLastName.Text = Empty) Or (tbFindLastName.Text = " ") Then
Error = MsgBox("I have nothing to search for!", vbExclamation, "Search Error!")
Else
SearchItem = tbFindLastName.Text
tbFindLastName.Text = Empty
SelectItem (SearchItem)
End If
End Sub
I want the range to include more information, currently the surname is in column 2 and the info for column 2 + 3 are only displayed. I want the info for column 1 to 9 to be displayed in the textbox.
Private Sub cmdFind_Click()
Dim SearchItem As String
Dim Error
If (tbFindLastName.Text = Empty) Or (tbFindLastName.Text = " ") Then
Error = MsgBox("I have nothing to search for!", vbExclamation, "Search Error!")
Else
SearchItem = tbFindLastName.Text
tbFindLastName.Text = Empty
SelectItem (SearchItem)
End If
End Sub
Last edited: