Change the primary key of a datarecord set

Started by lindir, May 23, 2014, 08:04:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lindir

Hello guys!

My programme need to link four shape to 4 most recent record on my Datarecord.
I set the primary key by row order on my datarecord set and  so link my shapes to the four higher row ID order.
The problem is that now, the row order are not good anymore the most recent value haven't the highest row Order.

I reorganize my datarecord set to organize it by Date from the most recent to the less recent, how can I reset the Primary key from this new row order.

Cf the attached picture
I tried this but the code don't work  'error 9 ' the indice doesn't belong to the selection
    aPrimaryKeyColumns(0) = "DebutPhase"
    vsoDataRecordset.SetPrimaryKey visKeyRowOrder, aPrimaryKeyColumns



Basicly my data record has 282 line and I want that the most recent value (from DebutPhase Column) have the highest ID row number
Thanks

Yacine

Yet another old post without answer.

a trivial solution would be to setup at database level a recordset with the four most recent records and change their values outside of visio.
Yacine