I have a view that has the first 2 columns sorted.
When a user presses the save button on a document I have the following code:
Dim keys(1 To 2) As String
keys( 1 ) = Source.FieldGetText("RECIPIENT")
keys( 2 ) = Source.FieldGetText("LAYOUT")
Set view = db.GetView ("FEM200PC" )
Set doc = view.GetDocumentByKey (keys,True)
.
.
.
.
I do this to make sure that a record with the same key does not exist.
This worked fine.
I then had a request to make the socond column sortable by the user.
When the user sorts the view then double clicks on a document and tries to save a doc.
The above code generates a ‘Too Many Keys’ error, since now the first column is unsorted.
If he then goes to the view and unsorts the view and tries again he does not get the error.
I tried adding code:
Set column = view.Columns( 0 )
If Not column.IsSorted Then
column.IsSorted = True
End If
Set column = view.Columns( 1 )
If Not column.IsSorted Then
column.IsSorted = True
End If
Call view.Refresh
Which I thought would resort the columns, but that does not help.
Any ideas on how to prevent the ‘too many keys’ error?
Thanks