Too many Keys

Good Afternoon,

I keep getting an error message after I run this code in my querysave:

Too many keys

I have my view Duplicate Checker set up as 3 columns and I am searching for the matches docStatus, docStart, and docData. I thought it was how i defined my array 0 to 2, but then I switched it to 1 to 3 and still got the same error message. Still new to LotusScript, any help would be appreciated.

    Dim docStatus As String

Dim docStart As String

Dim docData As String





docStatus = uidoc.FieldGetText  

    ("DutyStat")

docStart = uidoc.FieldGetText

    ("InspDate")

docData = uidoc.FieldGetText("TrprNum")





Dim dc As NotesViewEntryCollection

Dim Key(0 To 2) As Variant

Key(0) = docStatus

Key(1) = docData

Key(2) = docStart



Set view = db.GetView                   

    ("DuplicateChecker")

Set dc = view.GetAllEntriesByKey(Key, 

    True)

Subject: Too many Keys

If you are using 3 keys to lookup documents, make sure all 3 columns in the view are sorted also. Nonsorted columns do not count as lookup columns, and are ignored.

Subject: RE: Too many Keys

i thought i had them sorted, but i did not, fixing to run it through the debugger again, Thanks!

Subject: Too many Keys

Try type casting the column values in your view to string.(especially the column that holds a date value)I have encountered this same problem before when I tried to type cast them using @Text the error was fixed.

Hope this helps.

Subject: What line causes the error?

Subject: RE: What line causes the error?

I am not getting the error now because I switched the GetAllDocumnetsByKey(Key(0), True).I added the (0) behind Key.

It is collecting the right amount of documents, but only for the key(0), I need it to recognize the other two fields.