Information générale
Catégorie:
Codage, syntaxe et commandes
sorry to be a bother. I am tryint to "get it". I ended up loading the listbox with just 1 column. I am using the seqeuence number as the ItemID. Will this work?
select otemp
do while !eof()
this.list1.addlistitem(otemp.coll_desc,otemp.coll_seq,1)
skip + 1
enddo
Now when it is time to save the changes, I have the itemid which is the old sequence number, which will find the row in otemp, and i have listindex which will be the new sequence number. But I want to update by getting the table record first, then finding the listbox itemid. If I know otemp.coll_seq (the old sequence number) how do i find the corresponding itemid in the listbox? I do not know the syntax.
what does the .NewItemID do in the AddListItem in your example?
Thanks
Brenda
>** listbox.Init() -- or wherever you add items now
>select description, itemid ;
> from source_table ;
> order by sequence ;
> into array lasource
>lntally = _tally
>with this
> .ColumnCount = 1
> for ji = 1 to lntally
> .AddItem(lasource[ji,1])
> .AddListItem(transform(lasource[ji,2]), .NewItemID, 2)
> endfor
>endwith
>now the listbox is in stored order
>
>other than adding the 2nd column I'm assuming you have got this far.
>
>now the user moves the sequence around and commits the change
>** wherever this commit is made
>with thisform.listbox
> for ji = 1 to .ListCount
> ** 2 is the itemid column
> update source_table ;
> set sequence = ji ;
> where itemid = val(.List(ji,2))
> endfor
>endwith
>You get the idea.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement