>SELECT aed_hist >SET ORDER TO date >GO TOP && Go to first record >scatter memvar memo >THISFORM.lstAEDDisp_list.DisplayValue = m.aedid > >loRef = THISFORM >FOR ii = 1 TO loRef.ControlCount > DO CASE > CASE loRef.Controls(ii).BaseClass = "Listbox" > loRef.Controls(ii).DisplayValue = "" > loRef.Controls(ii).Value = "" <b>******* Why do you need this loop and case statement? ****** ***** If you want to reset DisplayBalue of all listboxes to nothing, you can use SetAll (see Help on SetAll). I would comment this block of code. </b> > ENDCASE >NEXT > >SEEKID = ALLT(m.incident)+ALLT(m.patnum)+ALLT(m.patqty) <b>** Another strange code: do you have alltrim in your index expression? You should NEVER use alltrim as part of index expression (see another quite recent discussion on similar topic)</b> >SELECT master >SET ORDER TO TAG incident >SEEK SEEKID <b> && Here you can change this block of code and use seek function instead</b> >IF NOT FOUND() > MESSAGEBOX("Master record NOT FOUND.",0+64,"AED History") >ELSE > savmaster = recno() >ENDIF >IF SEEKID != savseekid <b>&& What is SavSeekID</b> <b> Another important observation - you should always declare your variables as local (if, of course, you don't need them as private, otherwise your variables would be private by default and you may accidentally use the same name in calling procedure - we recently found this error in my colleague's code</b> > SELECT aed_hist > SET ORDER TO TAG incident > SCAN FOR ALLT(aed_hist.incident)+ALLT(aed_hist.patnum)+ALLT(aed_hist.patqty) = SEEKID <b>&& Once again - don't use alltrim here</b> > THISFORM.lstAEDDisp_list.AddItem(aed_hist.aedid) > ENDSCAN > WITH THISFORM <b>&& Here you can use with thisform.lstAEDDisp</b> > .lstAEDDisp_list.ListIndex = 1 > .lstAEDDisp_list.Requery > .lstAEDDisp_list.Refresh > ENDWITH > SEEK SEEKID > IF FOUND() > scatter memvar memo <b>&& May be you mean gather? </b> > ENDIF >ENDIF >Sorry for not answering your question, but hopefully these observations will help you.