I’ve had a look at the numerous “I cannot get GetAllEntriesByKey to work” forum entries and didn’t see anything that led to a solution for my problem - so, hoping someone can point out what (presumably) dumb error I’ve made.
Background - trying to build a collection based on a ‘key’ which is the concatenation of multiple fields in a form. I have a view where the ‘key’ is the first column and is sorted (have tried categorized and not categorized based on the conflicting entries I found in the Notes forums - no change in results). The result of the GetAllEntriesByKey is always a count of ZERO. In fact, debug mode shows not only viewentrycollection.count = 0, but query = “” implying to me that I may be using an invalid query or not supplying the query value properly.
Code below for your comment / input - thanks in advance:
Dim session As NotesSession
Dim db_import As NotesDatabase
Dim view_import As NotesView
Dim vc_import As notesviewentrycollection
str_import_view = “view_Labor_By_Key”
Set session = New NotesSession
Set db_import = session.CurrentDatabase
Set view_import = db_import.GetView(str_import_view)
view_import.AutoUpdate = True
key = “0176951/2/2009SK77XL0A00”
Set vc_import = view_import.GetAllEntriesByKey(key, True)
’ NOTE: Have also substituted the actual string where key appears in the above with same results
Get_Import_Collection = vc_import.Count
’ result = count = 0 and query = “”