>I have a listbox on a form.
>
>ControlSource is ATTS.
>
>RowSource is IIF(atts.EXT="YES",allt(str(atts.seqno))+" "+atts.placed+" via "+atts.route+" Extubated - "+ atts.ext_reas,allt(str(atts.seqno))+" " +atts.placed+" via "+atts.route)
>
>RowSourceType is Fields
>
>The form init and prev and next buttons have this code -
>
>* Find Attempts record that goes with Tube record
>CREATE CURSOR atts;
>(Ext C(3), Seqno N(2), Placed C(18), Route C(10), Ext_Reas C(12))
>
>ATTS_CNT=0
>SELECT attempts
>SCAN FOR attempts.mast_id = tube.mast_id
> SELECT atts
> APPEND BLANK
> REPLACE atts.ext WITH attempts.ext
> REPLACE atts.seqno WITH attempts.seqno
> REPLACE atts.placed WITH attempts.placed
> REPLACE atts.route WITH attempts.route
> REPLACE atts.ext_reas WITH attempts.ext_reas
>
> ATTS_CNT=ATTS_CNT+1
> SELECT attempts
>ENDSCAN
>SELECT tube
>
>
>All I want to know is how to update the listbox contents whenever it changes whether I am on this form or another form and return to this form.
>When I leave the form and add some records to atts and come back to the form it does not update the listbox unless I press Prev or Next button first. Any ideas what's wrong? Is there are better way to do this? I tried THISFORM.lstTube_tries.Requery and DODEFAULT(), but then the listbox refreshes, but other controls on the form disappear. Thanks for the help.
Make sure, that the form's main table is selected. Also you may surround your manipulations with thisform.lockscreen = .t. / .f.
If it's not broken, fix it until it is.
My Blog