Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table Unbinding itself
Message
From
12/08/2003 10:43:15
Brian Weber
Ohio Department of Development
Columbus, Ohio, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Table Unbinding itself
Miscellaneous
Thread ID:
00819366
Message ID:
00819366
Views:
51
Ok, I have searched through my code and have yet to find anything that is creating my problem. Here is the set up using Visual FoxPro 6.0. We have all of our tables and data bases hosted on the Q drive of our server, the forms and code are all on the P drive of our server, and the compiled end user programs sit on the M drive. I am currently working on a form that pulls filtered data from a table. The filter is based on year then by the type of funding. This produces a list from which the user can select the appropriate record. This is where the problem lies. The form will allow the user(or in this case, the tester) to select their first choice just fine. However, when the user goes back to make another selection, even if its the same exact record, the form bounces back an error saying the record could not be found. Now, this only occurs when a certain type of funding is selected. Using any other type of funding it works fine. This installation of FoxPro has had other issues ranging from mildly annoying to downright wierd, and I am begining to think it is to blame. However, I would rather not have to reclone this machine. Here is the problematic section of code that appears to be the problem.
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
ENDIF
Any 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.

TIA
Brian
Next
Reply
Map
View

Click here to load this message in the networking platform