apiSortStringArray not working

R

Robert Neville

I have been developing a search form; partly based on Dev Ashish's
findrecord2k.mdb. You may review the form at the following link.

http://www.mvps.org/access/forms/frm0045.htm

For some reason, the apiSortStringArray does not perform as expected
under Access 2002 and Windows XP. The function should sort an array
that will populate a combo box. I have been racking my brain for an
answer over the last 24 hours and have not unraveled the mystery. I
have checked all my reference in the VBA editor and compared them to
Dev's requirements. Could this situation occur on Access XP only?
Please let me know any insight on how to resolve this situation. Could
another reference conflict with this declaration statement? Does
anyone have any other sort methods for an unbound combo box filled by
an array?

--- Declaring Line ---
Private Declare Function apiSortStringArray _
Lib "msaccess.exe" Alias "#81" _
(astrStringArray() As String) As Long

--- Calling line ---
Call apiSortStringArray(sastrFields)
 
A

Arifah Addison

I had the same problem and resolved it by getting another array sortin
function from the following site:

http://www.dutchthewiz.com/vb/arrays/

go to the line as per below and download the zip file:
"Generic string sort routines. I prefer to use the 'non-pure' Quic
Sort unless you have a good reason to choose another routine. Phi
Fresle "

paste the vba code into a new module and save it. Then instead o
calling apiSortStringArray, call QuickSortStringsStart(sastrFields)
 
Top