Single search term - text or number?

  • Thread starter Thread starter Larry Rekow
  • Start date Start date
L

Larry Rekow

Firstly, I read a tip somewhere where one can, using the DRW and
modifying the code somewhat, search several fields in a d/b using a
single text box for entry. I've got it to work for any text fields,
but if i add a number field to the mix, it doesn't work. Is this at
all possible?
If not, I suppose i could have a second entry box, but I love the
simplicity of just having one.

Secondly, I've also done something similar to the above using just
ASP, but wondered how to have the ID field in the query results table
appear as a hyperlink, so the user could click on it to pass the value
of the ID to another page. Is there a simple answer for this?

Thanks,

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
 
Hi Larry:
For your second question, you may want to try this:
http://www.spiderwebwoman.com/tutorials/picklist.htm
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
many thanks for your answer, and for the dozens of times i've used
your great website for help.

I've successfully made hyperlinks out of ID numbers before using the
technique from the above mentioned page. However, what i'm attempting
now is to create a single search entry text box (searchterm) search
several fields (several text fields and one number field, the ID
field)

in that way, the user could enter either an ID number or a part of
text from other fields and get and answer. then, adding a hyperlink to
the ID field would be easy. the problem is that i can't come up with
a custom query in FP to search both text fields OR a number field (ID)
from a single search string. currently, using a query where the WHERE
section is something like

WHERE accountname LIKE '%::searchterm::%' OR vessel LIKE
'%::searchterm::%' OR ID = ::searchterm:: ...etc.

using just text fields works great, but he page fails if I add the
number field (ID)

Larry

- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
 
Larry,

You would need to create a text ID field if you want to use a single field
for searching multiple fields.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Larry,

You would need to create a text ID field if you want to use a single field
for searching multiple fields.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
thanks.

the ID fields i currently use, i have them issued automatically, using
a max(field)+1 type thingy. would this work if the field was a text
field?

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
 
It might.

I always use a separate table with a single text field to assign unique IDs
during the insert function of a record into another table, as text.

RecID = 1

set RecRS = server.CreateObject("ADODB.Recordset")
RecSQL = "SELECT R FROM ListingID WHERE ID = " & RecID
RecRS.Open RecSQL, Conn
ListNo = RecRS("R")
ListNo1 = (ListNo + 1)
Conn.Execute "update ListingID set R = '" & ListNo1 & "' where ID = " &
RecID

"ListNo" contains the number that I write to the other table.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Larry,

You would need to create a text ID field if you want to use a single field
for searching multiple fields.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wow....tried it and it works. dunno why i persist in using the
occasional number field when text seems to work so great for both date
and ID fields. somewhere along the line i got it stuck in my head
that numbers in text fields won't get treated like numbers or act like
them...but as this seems to reveal, they do indeed. thanks much for
pointing this out to me (again). this is gonna solve a host of
problems.

Larry

- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
 
Larry,

Now saving dates as text can be Ok, depending on how you want to use them in
the future. If you are not sorting or using them other than for display, a
text field is fine.

Depend on how you use numbers, you may just have to convert them from text
to number if you need to add them, etc. Otherwise you can use FormatNumber
to display them as a number.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top