Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record deleted from rowsource of ComboBox
Message
De
04/01/2010 16:49:25
 
 
À
04/01/2010 16:08:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01441974
Message ID:
01441991
Vues:
53
Now, when the cust table screen is opened, the ComboBox displays a blank, even though the cust.refby record still contains "Fall 08 Sample"

The customer sees this and thinks the cust.refby field is blank, when it's not.

Is there a way around this action?
**************************************************
*-- Class:        cbonotinlist
*-- ParentClass:  combobox 
*-- BaseClass:    combobox
*-- Time Stamp:   12/12/99 06:38:09 PM
*-- allows selection of an item not in the combo's list to be used as its controlsource...only works if the combo's bound column is 1
*
DEFINE CLASS cbonotinlist AS COMBOBOX

  *-- Used to save the control source of the combo before the control is unbound
  ccontrolsource = ""
  NAME = "cbonotinlist"


  *-- Called from Valid...it updates the "bound" field
  PROCEDURE updatecontrolsource
    LOCAL lcAlias, lcControlSource
    WITH THIS
      IF ! EMPTY( .ccontrolsource )
        lcAlias = JUSTSTEM( .ccontrolsource )
        IF UPPER( ALLTRIM( lcAlias ) ) = 'THISFORM'
          lcControlSource = .ccontrolsource
          STORE .DISPLAYVALUE TO &lcControlSource
        ELSE
          REPLACE ( .ccontrolsource ) WITH .DISPLAYVALUE IN ( lcAlias )
        ENDIF
      ENDIF
    ENDWITH

  ENDPROC


  *-- Updates display value from the field in the underlying table if this is a "bound" control
  PROCEDURE refreshdisplayvalue
    LOCAL lcControlSource
    WITH THIS
      IF ! EMPTY( .ccontrolsource )
        lcControlSource = .ccontrolsource
        .DISPLAYVALUE = &lcControlSource
      ENDIF
    ENDWITH
  ENDPROC


  PROCEDURE INIT
    IF DODEFAULT()
      WITH THIS
        .ccontrolsource = .CONTROLSOURCE
        .CONTROLSOURCE = ''
      ENDWITH
    ENDIF
  ENDPROC


  PROCEDURE VALID
    THIS.updatecontrolsource()
  ENDPROC


  PROCEDURE REFRESH
    THIS.refreshdisplayvalue()
  ENDPROC


  PROCEDURE GOTFOCUS
    IF LOWER( THIS.PARENT.BASECLASS ) = 'column'
      *** This is needed so it will work in a grid
      COMBOBOX::GOTFOCUS()
      THIS.refreshdisplayvalue()
      NODEFAULT
    ELSE
      DODEFAULT()
    ENDIF
  ENDPROC


ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform