Help with FTSearch

Hoping someone will see what I’m doing wrong here. I am having a fundamental problem with FTSearch where the search appears to work (returns expected COUNT = 1 in the collection), when I do a GetFirstDocument, a document is returned but has no values in any of the items. I have tried the FTSearch from the client GUI and it returns the expected form (which DOES have value in many of the ITEMS. Code below - any suggestions appreciated.

’ set up code

Set db_forecast = session.getDatabase(“”,str_forecast_name,str_forecast_name)

If Not db_forecast.IsOpen Then

	Messagebox("Could not open" & str_forecast_name)

	Goto ExitSub

End If

Call db_forecast.Updateftindex(True)

’ ftsearch code

Set dc_forecast = db_forecast.FTSearch(Form = “Forecast” & FWorkNum = str_work_number,0)

Set doc_forecast = dc_forecast.Getfirstdocument()

num_docs = dc_forecast.Count

*** RESULT - num_docs = 1 (as expected), doc_forecast is NOT Nothing - designer variable view shows ITEMS in doc_forecast but all values are null (the actual form returned in the client GUI does, in fact, have values)

Subject: Invalid argument data type and FT query syntax

Syntax:

Set notesDocumentCollection = notesDatabase.FTSearch( query$, maxdocs%, [ sortoptions% ], [ otheroptions% ] )

The first query$ parameter is a string. (also mentioned by Brian)

In addition, the FT query string syntax is incorrect.

You need to add Field keyword or for a field name.

Please refer to the help document for the syntax:

http://www-12.lotus.com/ldd/doc/domino_notes/6.5.1/help65_client.nsf/855dc7fcfd5fec9a85256b870069c0ab/e71745f2302f974385256dff00622436?OpenDocument

Subject: I don’t think your .FTSearch call is correct

I haven’t taken time to test this, but I’ve worked with FTSearch and I think that the following code:

Set dc_forecast = db_forecast.FTSearch(Form = “Forecast” & FWorkNum = str_work_number,0)

Should be something like:

Set dc_forecast = db_forecast.FTSearch(“Form = ‘Forecast’ & FWorkNum = str_work_number”,0)