aron.ridgway
Registered User.
- Local time
- Today, 18:17
- Joined
- Apr 1, 2014
- Messages
- 148
Hi there
i have got the bellow code that filters a listbox which is based on a query, from a textbox. The code works fine and it Filters, but if i put in too many characters that do not exsit in the data( so it cant display any results) i get an error saying Run time error 2105 - You cant go to the Specified record?
Has anyone got any tips on how i can catch this error so it does nothing apart from display a blank listbox with no error?
i have got the bellow code that filters a listbox which is based on a query, from a textbox. The code works fine and it Filters, but if i put in too many characters that do not exsit in the data( so it cant display any results) i get an error saying Run time error 2105 - You cant go to the Specified record?
Has anyone got any tips on how i can catch this error so it does nothing apart from display a blank listbox with no error?
Code:
Private Sub txtSearch_Change()
Me.lstShowSupplier.Requery
DoCmd.Requery
Me.txtSearch.SetFocus
If Not IsNull(Len(Me.txtSearch)) Then
Me.txtSearch.SelStart = Len(Me.txtSearch)
End If
End Sub