fj8283888 Posted September 13, 2004 Posted September 13, 2004 Hi, The following code is to find the record in the database, I have a question to ask that, this function will do the sorting before find the record, the problem is I want to keep the order as it shows in database. is it possible to find the record without sorting?? Public Function SearchUserName(ByVal test3 As String, ByVal coltosearch As String) As Integer If Not myds Is Nothing Then If (myds.Tables.Count > 0) Then myds.Tables("Staff").DefaultView.Sort = "FirstName" Return myds.Tables("Staff").DefaultView.Find(test3) Else Return -1 End If Else Return -1 End If End Function Thanks, fj8283888 Quote
*Experts* Nerseus Posted September 13, 2004 *Experts* Posted September 13, 2004 Why do you need the line: myds.Tables("Staff").DefaultView.Sort = "FirstName" ? -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
johansec Posted March 9, 2005 Posted March 9, 2005 Find searchs on the Sort field. Whichever field you sort by is the field the .Find uses to search on. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.