Convert Value List to SQL?
Posted on 2004-08-22
I am using the following code to generate a Value List as the Row Source for a listbox. I am trying to find a way to be able to sort the listbox. All the methods that I have found so far involve changing the ORDER BY portion of an SQL statement and since I don't have an SQL statement, I can't use those methods to sort the listbox.
So. . . ,
- is there an easy way to convert my Value List to an SQL statement,
- is there an easy way to sort a listbox when the row source is a value list and not a SQL?
Thanks. here is the code:
DocumentList = "Document Name;Date;Time;"
DocumentName = Dir(OPTCPath & Right(CurrentYear, 2) & "\Correspondence\*.*")
Do While Len(DocumentName) > 0
If Left(DocumentName, 15) = CurrentRoll Then
DocumentDate = Format(ShowFileInfo(OPTCPath & Right(CurrentYear, 2) & "\Correspondence\" & DocumentName), "dd-mmm-yy")
DocumentTime = Format(ShowFileInfo(OPTCPath & Right(CurrentYear, 2) & "\Correspondence\" & DocumentName), "hh:mm:ss AMPM")
DocumentName = Right(DocumentName, (Len(DocumentName) - 15))
DocumentList = DocumentList & DocumentName & ";" & DocumentDate & ";" & DocumentTime & ";"
DocumentName = Dir
Me.lstDocList.RowSource = DocumentList