Search formula

Am I on the right track with this search formula?

'view to choose a document from

server= dbCurr.server

dbname= dbCurr.FileName

viewname = “showlocation”

'list of documents for selection

picklist = ws.Pickliststrings(3,1,server,dbname,viewname, “”,“Select a Location.”,3,“”)

If Isempty(picklist) Then Exit Sub 'they have pressed cancel

location = picklist(0)

'build search for collection

searchFormula$ = |Form = “form1” & location = |

Set db = session.CurrentDatabase

Set collection = db.FTSearch (searchFormula$,0)

If collection.Count > 0 Then

Set doc2 = db.CreateDocument

Subject: search formula

Loyd,

Hmmm, maybe …

searchFormula$ = |Form = “form1” & location = “| & location & |”|

regards,

raphael

Subject: RE: search formula

Am I on the right track with this search formula?

No; you’re using the syntax of database search (macro language, db.Search) as input to a full-text search (FTSearch), which uses a very different syntax. The full-text search syntax is documented in the user help (not the Designer help).

In this case, however, I think it’s better to forget about using db.Search or db.FTSearch. With the specific search you’re attempting, it will be more efficient to use NotesView.GetAllDocumentsByKey in a view that’s sorted by location.