So far I have tried using the Msort functions in conjunction with setting
the UDF as a key field with no luck. It just sorts the buit-in key field when
I call msort:
Private Sub ccustid_Chk(ChkStrg As String, retval As Integer)
Dim MemHandle As Integer
If ChkStrg <> "" Then
MemHandle = GetGridHandle("Spread1")
Call MKey(MemHandle, 0, "bardoc1.user6", False)
'Call MKey(MemHandle, 0, "bardoc1.refnbr", False)
Call MSort(MemHandle)
Call MUpdate(OrigGridHandle)
Call MDisplay(OrigGridHandle)
End If
End Sub
A tiny irelevant point - I don't think your mUpdate statement is a good
idea.
mUpdate is used when you have modified the buffer, and want to update it
back into the array.
Here, you haven't modified the buffer, and (assuming a Sort has taken place)
the kernel has been shuffling the array.
So I don't see mUpdate doing any good - and I think it could possibly do
some harm.
However, that is (a) a bit of a guess on my part, and (b) not very relevant
to your sorting problem anyway.
I agree with Steve that modifying the Order-By clauses in the stored
procedure(s) is probably the easiest way.
However, I am very reluctant to modify standard Solomon stored procedures.
And I agree with you that the modified procedures will revert to the
standard versions when you perform any sort of upgrade.
I don't think I have used mKey or mSort in a customization, so I've no
experience to draw on there.
I have used mKeyOffset and mKeyFind, but there was no Grid involved, and I
think they are a bit of a different subject anyway.
I did wonder whether the grid had been loaded at the point when your code
runs.
But I think it has.
I note that your grid handle for most of your code is MemHandle.
But the mDisplay uses OrigGridHande.
That doesn't look right.
Is that just a typo in the code you posted?
If its not a typo, then you are possibly not succeeding in displaying the
modified grid.
I note that Help for mKey says that you must previously have executed a
vba_SetAddr.
In your case, you won't have your "own copy" of bARDoc1, so the SetAddr will
be the one that has been executed by the host screen. I assume that is OK...
Just a few ramblings that probably aren't much use, I'm afraid.
Barry
--
Barry Flynn
Complete Solutions DG
"docsis" <doc...@discussions.microsoft.com> wrote in message
news:D3FDA034-B3EB-4EC2...@microsoft.com...
> .
>