Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table Unbinding itself
Message
From
13/08/2003 10:22:22
Brian Weber
Ohio Department of Development
Columbus, Ohio, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00819366
Message ID:
00819756
Views:
18
Sorry i didnt answer the question about the lost focus calls. They are used to trigger code that is in the lost focus action of the object. I'll post the lost focus code now.
select grants
** determine which pages need to be active
*
* DEFAULT TO NO HOME OWNERSHIP DATA TO INPUT
VATTACH = .F.
* DEFAULT TO NO HOUSING RENTAL DATA TO INPUT
VHDAP = .F.
* NO TBRA DATA NEEDED
VTBRA = .F.
* NO ESGP DATA NEEDS ENTERED
VESGP = .F.
*
thisform.cmdbutton_close.enabled=.t.
thisform.pageframe.page1.cmdgo_first.enabled=.t.
thisform.pageframe.page1.cmdgroup.command1.enabled=.t.
thisform.pageframe.page1.cmdgroup.command2.enabled=.t.
*
* DETERMINE IF THE DEFAULT NEEDS CHANGED
*
IF VFTYPE = 'L' .OR. VFTYPE = 'E' .OR. VFTYPE = 'J'.OR. (VFTYPE = 'C' .AND. SUBSTR(VGRANT_NBR,3,1) = 'L')
  * ESGP DATA
  if vyear > '1997'
    * only collecting esg data after program year 1997
    VESGP = .T.
  else
    * 1997 and prior years do not collect esgp data
    vesgp = .f.
  endif
ENDIF
*
IF AT(VFTYPE,"CH") > 0 .AND. AT(SUBSTR(VGRANT_NBR,3,1),"BCDFK") > 0
  * DETEMINE IF THE GRANT HAS HOUSING DATA TO INPUT
  * CDBG/HOME FUNDS MAY REQUIRE ADDITIONAL DATA INPUT
  * CHIP, HDAP, DISCRETIONARY, OR FORMULA GRANT AWARDS
  *
  IF VFTYPE = 'H'
    * HOME DATA - LOOK IN FIS_IDIS TABLE TO DETERMINE TENURE TYPE
    *
    * FOR HDAP ACTIVITIES NEED HOUSING ATTACHMENT ONLY
    IF AT(SUBSTR(VGRANT_NBR,3,1),"BK") > 0
      * HDAP DATA INPUT REQUIRED
      * DETERMINE IF IT IS HOMEOWENERSHIP OR A RENTAL PROJECT
      SELECT FIS_IDIS
      * HDAP PROJECT - ACTIVITY NUMBER IS N/A
      vact_nbr = '00'
      SET FILTER TO GRANT_NBR = VGRANT_NBR .AND. ACT_NBR = vact_nbr
      GO TOP
      *
      IF EOF()
        * ERROR NOT IN FIS_IDIS
      ELSE
        IF TENURE_TYP = '0'
          * TBRA ACTIVITY
          VTBRA = .T.
        ENDIF
        IF TENURE_TYP = '1'
          * RENTAL ACTIVITY
          VHDAP = .T.
        ENDIF
        IF TENURE_TYP = '2' .OR. TENURE_TYP = '3'
          * HOMEOWNERSHIP ACTIVITY
          VATTACH = .T.
          IF SETUP_TYPE = '2' .OR. SETUP_TYPE = '3' .OR. SETUP_TYPE = '5'
            * NOT A REHAB TYPE PROJECT - ENTER INTIAL PRICE
            VREHAB = .F.
          ELSE
            * REHAB TYPE PROJECT - ENTER AFTER REHAB VALUE
            VREHAB = .T.
          ENDIF
        ENDIF
      ENDIF
      SELECT GRANTS
    ELSE
      * OTHER HOME FUNDED GRANTS - CHIP AND DISCRETIONARY
      * CHIP/DISCRETIONARY GRANTS NEED ACTIVITY NUMBER
      SELECT FIS_MAIN
      SET FILTER TO GRANT_NBR = VGRANT_NBR
      GO TOP
      DO WHILE .NOT. EOF()
        STORE ACT_NBR TO vact_nbr
        SELECT FIS_IDIS
        SET FILTER TO GRANT_NBR = VGRANT_NBR .AND. ACT_NBR = vact_nbr
        GO TOP
        *
        IF EOF()
          * NOT IN FIS_IDIS - MAY NOT BE A HOUSING ACTIVITY WITH BUDGETED FUNDS
        ELSE
          IF TENURE_TYP = '0'
            * TBRA ACTIVITY
            VTBRA = .T.
          ENDIF
          IF TENURE_TYP = '1'
            * RENTAL ACTIVITY
            VHDAP = .T.
          ENDIF
          IF TENURE_TYP = '2' .OR. TENURE_TYP = '3'
            * HOMEOWNERSHIP ACTIVITY
            VATTACH = .T.
            IF SETUP_TYPE = '2' .OR. SETUP_TYPE = '3' .OR. SETUP_TYPE = '5'
              * NOT A REHAB TYPE PROJECT - ENTER INTIAL PRICE
              VREHAB = .F.
            ELSE
              * REHAB TYPE PROJECT - ENTER AFTER REHAB VALUE
              VREHAB = .T.
            ENDIF
          ENDIF
        ENDIF
        SELECT FIS_MAIN
        SKIP
      ENDDO
      SET FILTER TO
      SELECT GRANTS
    ENDIF
  ELSE
    * CDBG FUNDED HOUSING GRANTS - CHIP, FORMULA, AND DISCRETIONARY
    * CDBG FUNDED GRANT - WILL NEED TO USE FIS_MAIN TABLE TO DETERMINE
    *                RENTAL VS. HOMEOWNERSHIP PROJECTS
    SELECT FIS_MAIN
    SET FILTER TO GRANT_NBR = VGRANT_NBR .AND. ACT_CLASS = 'C' .AND. ACT_AMT > 0
    GO TOP
    DO WHILE .NOT. EOF()
      IF ACT_CODE = '18'
        * TBRA ACTIVITY
        VTBRA = .T.
      ENDIF
      IF INLIST(ACT_CODE,'21','23','41','60','61')
        * HOMEOWNERSHIP ACTIVITY
        VATTACH = .T.
        IF ACT_CODE = '60'
          * NOT A REHAB TYPE PROJECT - ENTER INTIAL PRICE
          VREHAB = .F.
        ELSE
          * REHAB TYPE PROJECT - ENTER AFTER REHAB VALUE
          VREHAB = .T.
        ENDIF
      ENDIF
      IF ACT_CODE = '28'
        * RENTAL ACTIVITY
        VHDAP = .T.
      ENDIF
      IF INLIST(ACT_CODE,'22','45','46')
        * COULD BE RENTAL OR HOMEOWNERSHIP
        IF UNIT_MEAS1 = '29' .OR. UNIT_MEAS1 = '55' .OR. UNIT_MEAS1 = '57'
          * RENTAL ACTIVITY
          VHDAP = .T.
        ELSE
          * HOMEOWNERSHIP ACTIVITY
          VATTACH = .T.
          IF UNIT_MEAS1 = '32'
            * REHAB TYPE PROJECT - ENTER AFTER REHAB VALUE - SHOULD NOT HAPPEN AFTER FY 2002
            * NEW CONSTRUCTION ACTIVITY THAT IS ACQUISITION/REHAB/RESALE
            VREHAB = .T.
          ELSE
            * NOT A REHAB TYPE PROJECT - ENTER INTIAL PRICE
            VREHAB = .F.
          ENDIF
        ENDIF
      ENDIF
      SKIP
    ENDDO
    SET FILTER TO
    SELECT GRANTS
  ENDIF
ENDIF
*
*  Lock Grants File for FPR Date Input
do lockcheck
*
if sys(2011) = 'Record Unlocked'  && could not lock record in grants file
  go top
  thisform.lstgrant_nbr.setfocus
else
  if vfed_state = "Federal"
    thisform.txtgrant_amt.value = (grants.grant_amt + grants.setup_amt)
  else
    thisform.txtgrant_amt.value = grants.grant_amt
  endif
  select fis_main  
  set filter to grant_nbr=vgrant_nbr  && .and. act_amt>0
  go top
  vact_code=act_code
  *
  if eof()
    thisform.pageframe.page1.txtact_amt.value = 0
  else
    thisform.pageframe.page1.txtact_amt.value = act_amt
  endif
  select cl_rslt
  go top
  *
  do lockcheck      && locking Closeout File
  *
  if sys(2011) = 'Record Unlocked'  && could not lock record
    select grants
    go top
    thisform.lstgrant_nbr.setfocus
  else
    vnext = 0
    this.visible=.f.
    thisform.txtfpr_dt_rec.enabled=.t.
    thisform.cbofpr_review.enabled=.t.
    thisform.txtfpr_to_rev.enabled=.t.
    thisform.txtclose_status.enabled=.t.
    thisform.cbofpr_comp.enabled=.t.
    thisform.txtgrant_nbr.visible=.t.
    thisform.txtgrantee.visible=.t.
    vgrantee=thisform.txtgrantee.value
    thisform.txtgrant_amt.visible=.t.
    thisform.txtfpr_dt_rec.visible=.t.
    thisform.cbofpr_review.visible=.t.
    thisform.txtfpr_to_rev.visible=.t.
    thisform.txtclose_status.visible=.t.
    if vfed_state = "Federal"
      thisform.lblfpr_comp.visible=.t.
      thisform.cbofpr_comp.visible=.t.
      thisform.cbofpr_comp.value = grants.cert_rec
    endif
    select grants
    thisform.pageframe.page1.cmdgroup.enabled=.t.
    thisform.refresh
    thisform.txtfpr_dt_rec.setfocus
    select cl_rslt
  endif
endif
thisform.txtfed_state.enabled=.T.
thisform.txtprog_year.enabled=.T.
thisform.refresh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform