Click to See Complete Forum and Search --> : arrays (multidimensional)


February 25th, 2000, 01:12 PM
Hi,
here is my question. I have 2 fields in my recordset. A rs!relationship(mother, father.....) and rs!relation_id. I need to populate an array with both of these fields of the rs. I also have a grid where these fields show up in 2 columns. When the user tries to change a name I have to call the array and see if that relationship in that particular cell and row already has an id. (e.g. mother = 1, father = 2....). If the relationship matches with an id than I have to take this id and put it in a variable(relationId) for further use. If the relationship is not in the array I need to add it to the array and give it a new id and take that new id and put it in the variable(relationId).
I have absolutely no glue about arrays. So, please help!!!!!!! I am working with an adodb.rs.
Thanks for any help that I can get.
Christa

Atlantisoft
February 25th, 2000, 01:44 PM
I didn't completely understand your question, so this may or may not work. Try using a for next loop inside of another for next loop, looping through the multidimensional control arrays and checking them to see if they match. for example...

For Blah = 0 to FirstDimensionLimit
For Blah2 = 0 to SecondDimensionLimit
GridCell(Blah,Blah2) = MyControlArray(Blah, Blah2)
Next Blah2
Next Blah

Again, I didn't completely understand your question, so I don't know if this helps. Hope it does.

February 25th, 2000, 02:20 PM
Thanks for your answer, but this is not quite what I'm looking for. I need to populate the array(1,6) (1 = two columns(relationship and id),6 = possible # of ids, mother = 1, father = 2 etc) with the 2 fields in the rs.(which I don't know how) Then I need to compare the value of the cell(relationship column, eg mother) in the grid and find out if there is already a "mother" in the array and what id "she" has. If she has an id I need to take that id and put it in the cell(id column), update the rs and go on with life. If mother is not in the array I have to add it to the array, add an id, than take that information, put it in the cell, update my rs and go on..
I hope this explains it a little better.
Any glues?
Thanks a lot for any help.