|
rdouglass -> RE: search on multiple fields (3/27/2002 15:21:38)
|
Would you actually need to SEARCH on the ID number or just reference it? If you HAD to use 1 text box to search either ID, FirstName, or LastName, I would first test the text box for numerical data (to decide whether to use ID search or First/Last Name search. Using the example above and expanding on it put something like: <% DIM strSQL IF IsNumeric(Name) THEN strSQL = "(ID = ::Name::)" ELSE strSQL ' "(First_Name LIKE '%::Name::%' OR Last_name LIKE '%::Name::%')" END IF%> then the query would look something like: fp_sQry="SELECT * FROM Table1 WHERE " & strSQL Haven't tested this but I have done similar type things and it seems to work OK. Hope it helps...
|
|
|
|