IF !EMPTY(THIS.Value) *add the value to the list box *------------------------------ thisform.txtgrant_nbr.value=this.value vgrant_nbr=this.value vftype=grants.f_type * select cl_rslt set filter to grant_nbr=vgrant_nbr go top count to Vact_count go top vnbr_act=1 thisform.pageframe.page1.txtrec_nbr.value="Activity " + ltrim(str(Vnbr_act))+ " of " + ltrim(str(vact_count))+" Budget Records for this Grant" go top if vact_count=0 if messagebox("The selected grant number does not exist in the closeout files. To add it, verifiy the correct grant number was selectected and click yes. To select another grant number, click no.",292,"Adding Grant to Closeout File")=6 && bring in all necessary fiscal info by activity from the fis_main files append from &ffis_main for grant_nbr=vgrant_nbr set filter to grant_nbr=vgrant_nbr go top replace f_type with vftype all go top count to vact_count go top thisform.pageframe.page1.txtrec_nbr.value="Activity " + ltrim(str(Vnbr_act))+ " of " + ltrim(str(vact_count))+" Budget Records for this Grant" && bring in all necessary fiscal info by specific projects from the fis_prj files if vfed_state='Federal' select fis_prj set filter to grant_nbr=vgrant_nbr go top do while ! eof() vprj_nbr=prj_nbr vact_nbr=act_nbr select cl_prj locate for grant_nbr=vgrant_nbr .and. prj_nbr=vprj_nbr .and. act_nbr=vact_nbr if eof() append from &ffis_prj for grant_nbr=vgrant_nbr .and. prj_nbr=vprj_nbr .and. act_nbr=vact_nbr .and. ! tbra_act endif select fis_prj skip enddo endif select cl_rslt this.lostfocus else && chose 'no' in selection box and selecting another grant number thisform.txtfed_state.enabled=.T. thisform.txtprog_year.enabled=.T. thisform.refresh thisform.txtprog_year.setfocus endif * enter ESG records into ESG data table if substr(vgrant_nbr,3,1)='L' .or. substr(vgrant_nbr,1,1)='L' .or. substr(vgrant_nbr,1,1) = 'J' .or. substr(vgrant_nbr,3,1)='J' .or. (substr(vgrant_nbr,3,1)='D' .and. vftype='E') vshelter=" " select cl_esg set filter to grant_nbr=vgrant_nbr go top count to vcount if vcount=0 select fis_main set filter to grant_nbr=vgrant_nbr go top do while ! eof() if (num_meas1 + num_meas2 + num_meas3 > 0) .AND.location#vshelter vshelter=location select cl_esg append blank replace grant_nbr with vgrant_nbr replace shelter with vshelter set filter to grant_nbr=vgrant_nbr go top endif skip enddo endif endif else && vact_count is not = to zero if vfed_state='Federal' && verify that all projects in fis_prj are in cl_prj select fis_prj set filter to grant_nbr=vgrant_nbr go top count to vfprj_count go top select cl_prj set filter to grant_nbr=vgrant_nbr go top count to vcprj_count go top * if vcprj_count#vfprj_count * check for projects in fiscal but not in close files select fis_prj set filter to grant_nbr=vgrant_nbr go top do while ! eof() vprj_nbr=prj_nbr vact_nbr=act_nbr select cl_prj locate for grant_nbr=vgrant_nbr .and. act_nbr=vact_nbr .and. prj_nbr=vprj_nbr if eof() append from &ffis_prj for grant_nbr=vgrant_nbr .and. act_nbr=vact_nbr .and. prj_nbr=vprj_nbr .and. ! tbra_act endif select fis_prj skip enddo * * now check for projects in close but not in fiscal files select cl_prj set filter to grant_nbr=vgrant_nbr go top do while ! eof() vprj_nbr=prj_nbr vact_nbr=act_nbr select fis_prj locate for grant_nbr=vgrant_nbr .and. prj_nbr=vprj_nbr .and. act_nbr=vact_nbr if eof() * not in fiscal - delete in close out select cl_prj do while act_nbr=vact_nbr .and. prj_nbr=vprj_nbr .and. .not. eof() delete skip enddo else select cl_prj skip endif enddo select fis_prj endif endif * verify that ESG records are in ESG data table if substr(vgrant_nbr,3,1)='L' .or. substr(vgrant_nbr,1,1)='L' .or. substr(vgrant_nbr,1,1)='J' .or. substr(vgrant_nbr,3,1)='J' .or. (substr(vgrant_nbr,3,1)='D' .and. vftype='E') vshelter=" " select cl_esg set filter to grant_nbr=vgrant_nbr go top count to vcount if vcount=0 select fis_main set filter to grant_nbr=vgrant_nbr go top do while ! eof() if (num_meas1 + num_meas2 + num_meas3 > 0) .AND.location#vshelter vshelter=location select cl_esg append blank replace grant_nbr with vgrant_nbr replace shelter with vshelter endif select fis_main skip enddo select cl_esg set filter to grant_nbr=vgrant_nbr go top endif endif this.lostfocus endif ELSE thisform.refresh this.setfocus ENDIFAny help in figureing what is going wrong would be much appricated. Like I said, I searched the code and couldnt find anything, but then again I'm not great at tearing my own code apart.