Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keyword Search

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'd like to design a macro that (1) searches a piece of text (HTML, RTF, etc.) for specific keywords; and (2) outputs the source of those keywords. I'm asking because I'm trying to design a database of literary texts, so that you can type in a keyword (i.e. a name, "Beowulf") that will respond with a title/place.
 
So, what is it you are asking? Presumably, how to design the macro.

First of all, it is difficult to understand what you are trying to do. You say you want to search HTML/RTF text. Is this in external files or is the text stored as data in the database? I can only see that it would work in the latter case.

Also, I would use a query rather than a macro. If you had a table of texts with fields [text] and [title], and a text box into which the user types the word being searched for (e.g. txtSearchWord) then you could do a query that has criteria for the [text] field as something like 'Like "*" & Forms![FromName]![txtSearch] & "*"'. This would search for the string in the text field. If the [title] field is included in the query, the records produced will be those titles whihc include the search string in their text.

If this is not what you are thinking of and you actually want to search extenral files, that would be much more complicated and involves non Access-specific techniques. Have fun! :eek:)

Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top