Click to See Complete Forum and Search --> : UDT Array and FlexGrid


October 8th, 1999, 09:52 AM
Having problem updating a flexgrid with the contents of a UDT array. I have 10 customer records, each of which has 10 pieces of data. I need to search the array based on what user types into a text box and then update the flexgrid with data from the array. User can only search on the "name" field. All items in the array are strings.

Think I know how to use InString to determine WHAT records to use for update, but not sure on code for loading them into the flexgrid. Should I be using the TextMatrix property? If so, how would this work in some sort of loop that would go through the entire array?

Any help for this beginner would be GREATLY appreciated.

Ravi Kiran
October 9th, 1999, 01:45 AM
Yes, use TextMatrix property.
something like this: if udtAr() is the array of udt then

for i = LBound(udtAr,1) to UBound(udtAr,1)
With MSFlexGrid1
j = 0
.TextMatrix(.FixedRow + i,.FixedColumn + j) = udtAr(i).JthField
j = j + 1
.TextMatrix(.FixedRow + i,.FixedColumn + j) = udtAr(i).JthField
' Since it is an UDT, i guess you have to list out all the fields like this:
' if it is a collection, you could have used
' another for loop
end with
next i




RK