Hi
I am trying to select certain rows in a matrix, not a user defined one but an actual sbo one. I have tried using the omatrix.select method but vb gives me an error about the item is not a user defined item and cannot be manipulated in such a manner.
Anyone got any ideas please ?
Regards Andy
This code contains your solution.
It iterates over each line in a SYSTEM matrix, and tests for a value in a column. If the value in the column is in a list, it will select that row by executing a 'Click' on the first column in the list.
It has multiple selection logic in it as well, as more than one row in the list may be valid.
NumberOfReceiptsFoundInMatrix = 0
For RowIndex = 1 To ReceiptMatrix.RowCount
Debug.Print ReceiptMatrix.Columns("DocNum").Cells(RowIndex).Specific.Value
If ExistsInCollection(CLng(ReceiptMatrix.Columns("DocNum").Cells(RowIndex).Specific.Value), ReceiptNumbers) = True Then
If NumberOfReceiptsFoundInMatrix = 0 Then
'
' Single select
'
Call ReceiptMatrix.Columns(1).Cells(RowIndex).Click(ct_Regular)
Else
'
' Multiple select for all further Receipts
'
Call ReceiptMatrix.Columns(1).Cells(RowIndex).Click(ct_Regular, mt_CTRL)
End If
'
' Track the number of Receipts that have been found, so the searching can stop once all
' the Receipts have been selected.
'
NumberOfReceiptsFoundInMatrix = NumberOfReceiptsFoundInMatrix + 1
End If
If NumberOfReceiptsFoundInMatrix = ReceiptNumbers.Count Then
'
' Break out of for loop early if all of the Receipts have been found.
'
Exit For
End If
Next RowIndex
Most system form have restrictions to what the SDK can do with them... But try clicking the grayed-out column in the system matrix... Most system matrices selcet rows that way....
Add a comment