G
Gail
I am using a callback function provided by
Microsoft Knowledge Base Article # 210442
for a list box that displays a single column list of names
from a stored query. I want to include a second column in
the list box that displays the ID number (datatype long)
for each row, making it a multi-column list box. I have
searched extensively for an example of an array that will
return a multi-column list but have not found anything
that shows specifically how to do it. Here is the part of
my code that return the Name field:
Select Case intCode
Case acLBInitialize
Set db = CurrentDb()
Set rst = db.OpenRecordset("SELECT PatientID,
Name FROM qry_search_results")
intArrayCount = 0
ReDim Preserve aryTestArray(0)
' Fill the array.
With rst
intNumRec = rst.RecordCount
Do Until rst.EOF
' Fill the array row with the last name.
aryTestArray(intArrayCount) = ![Name]
' Increase the number of elements in the
array
' by one to accommodate the next record.
ReDim Preserve aryTestArray(UBound
(aryTestArray) + 1)
intArrayCount = intArrayCount + 1
.MoveNext
Loop
' Remove the remaining empty array row.
ReDim Preserve aryTestArray(UBound
(aryTestArray) - 1)
.Close
End With
db.Close
' View the array contents.
For intCounter = 0 To intArrayCount - 1
varValue = aryTestArray(intCounter)
Next intCounter
varRetVal = True
etc., etc.
Thanks for any enlightenment!
Microsoft Knowledge Base Article # 210442
for a list box that displays a single column list of names
from a stored query. I want to include a second column in
the list box that displays the ID number (datatype long)
for each row, making it a multi-column list box. I have
searched extensively for an example of an array that will
return a multi-column list but have not found anything
that shows specifically how to do it. Here is the part of
my code that return the Name field:
Select Case intCode
Case acLBInitialize
Set db = CurrentDb()
Set rst = db.OpenRecordset("SELECT PatientID,
Name FROM qry_search_results")
intArrayCount = 0
ReDim Preserve aryTestArray(0)
' Fill the array.
With rst
intNumRec = rst.RecordCount
Do Until rst.EOF
' Fill the array row with the last name.
aryTestArray(intArrayCount) = ![Name]
' Increase the number of elements in the
array
' by one to accommodate the next record.
ReDim Preserve aryTestArray(UBound
(aryTestArray) + 1)
intArrayCount = intArrayCount + 1
.MoveNext
Loop
' Remove the remaining empty array row.
ReDim Preserve aryTestArray(UBound
(aryTestArray) - 1)
.Close
End With
db.Close
' View the array contents.
For intCounter = 0 To intArrayCount - 1
varValue = aryTestArray(intCounter)
Next intCounter
varRetVal = True
etc., etc.
Thanks for any enlightenment!