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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Notes search problem

Status
Not open for further replies.

Djbell

IS-IT--Management
Apr 22, 2002
175
GB
Hi All

I have been asked by my company to introduce a type of search on one of our main forms, what they would like is a button and text box. The search item gets typed into the text box then once the search button has been clicked it will search a particular view and field for all instances of the word in the text box, this should then bring up a dialog box with the search results, this will allow the user to select one of the results which will then populate the fields on the form.

My first thought was using a picklist which did work, but unfortuantly a picklist does not do a free text search, it only matches the word. So for example if I searched for card it would display matches for the word card but not words like cardoard, precard ect ect.

My second thought was using the button to run an agent.

The agent would do an FTsearch based on the word in the text box using the * wildcard for anything that the word was in. Then the results of this worlb be place in a private folder and a picklist would be used to display the result of the folder so the user could pick the information needed to populate the form.

But I just can not figure out how to do the above, I would need everything done in the backgroud so the user was always on the main form and when the search button is clicked all they would see is the picklist with the results. I have tried different coding for the agent but all come up with the same error that they need to be run from within a view.. I need it to be run from within the form.

Sorry know its a bit long wifted.

Hope you can help

Regards

Djbell
 
You need to do one of two things :
1) educate your users in the use of the Search Bar and its syntaxe, or
2) write an agent that takes the input and conducts the search following your specifications (construct the search criteria yourself).

I have long been partisan to the first solution, but after ten years of consultancy, I have seen the futility of trying to teach someone something they don't want to know.
Instead, I create a subform with the specific criteria they want to search on, then write an agent that pops up the subform in a dialog box, analyses the content, builds the search string and launches the search. The result is that the user can specify what data he wants to search for in what field, and get the result in a view, like a normal search.
Popping up search results in a dialog box is a major hassle by the way, not worth the effort.

The code to build the search string is like this :
Code:
sstring = "[" & fieldname & "] CONTAINS " & value
call db.search(sstring)

That should handle your search, and you can forget the form.

Pascal.
 
Hi Thanks for the reply.

The reason I need it to run from the form is that the resluts from the view will populate the main form with information in about 10 fields.

The form has 10 fields plus the search facility, they need it so when they put in a search criteria say the work wood it displays all records that has wood in the description then they can choose one of those records and populate this to there form. The system is an electronic ordering system based on notes. The form with search on it takes this inofmation and creates a dynamic table with there selection. Think of it as a Dataview subform that is used within access.

Regards

Douglas Bell
 
Search is not your solution then.
You need to design an agent that will go through all the documents, find the relevant data, and populate your document fields.
It's a lot longer, harder to debug, but I cannot think of any other way to respond to your issue.

Pascal.
 
First, you need to forget everything you learned about relational databases when working with notes.

It sounds like you want to run a query, let the users view the results of the query, select a specific record based on the query results (which the user selects) and then fill in a form based on the selected record.

In notes, you want to find all the documents that have matching criteria, show all the documents in a view or folder, let the user select the document they are interested in and then open that document in a form.

Does that sum it up? I'm just trying to clarify so that we don't point you in the completely wrong direction!

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Hi Pmonett / Leslie

Thanks for the replys. Hi Leslie, yes thats about it, the results that the user selects from the search fills in three fields on selection then the user has two fields on this form that they manually fill in. I have an ok button on this form when clicked takes this information and populates a dynamic table on the main requisition form. SO each time the item form is used it allows another line to be added to the dynamic table, it also allows the user to delete a line or amend a line of the dynamic table. The records that I want to search on, are being imported from a view from our MRP system, at the moment on import into notes I have the description broken down into words, then I have the view categorised by the words, this is what I do the pick list on for the selection, but as I said that will only match specific words, but I need it to be a free text selection instead.

Regards

Djbell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top