Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Smart dropdowns
Message
 
 
À
11/06/2001 13:19:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00517916
Message ID:
00517966
Vues:
18
You figure correctly. The following is the code that worked for me. I added a States combo and a Cities combo. In the InteractiveChange of the States, I requeried the Cities combo after setting its cState property. Note, that the SQL for the Cities had to have an absolute reference to the cCities property. I would get an error if I used This.cState instead of ThisForm.cboCities.cState. I have also removed irrelevant code. You need to actually add the code to the appropriate methods instead of running this code as is.
DEFINE CLASS TestForm AS form

   ADD OBJECT cbostates AS cmbobox WITH ;
      ColumnCount = 1, ;
      ColumnWidths = "120", ;
      RowSourceType = 3, ;
      RowSource = "select distinct state from r6snc order by State into cursor crsStates", ;
      Height = 24, ;
      ColumnLines = .F., ;
      Left = 51, ;
      Top = 16, ;
      Width = 74, ;
      Name = "cboStates"

   ADD OBJECT cbocities AS cmbobox WITH ;
      ColumnCount = 1, ;
      ColumnWidths = "200", ;
      Height = 24, ;
      ColumnLines = .F., ;
      Left = 223, ;
      Top = 17, ;
      Width = 262, ;
      Name = "cboCities"

   PROCEDURE cbostates.intactchange
      with This.Parent.cboCities
         .cState = This.DisplayValue
         .Requery()
      endwith
   ENDPROC
   PROCEDURE cbocities.Init
      DoDefault()
      This.AddProperty('cState', '~~')
      This.RowSource = 'select distinct city from r6snc where State = ?ThisForm.cboCities.cState order by City into cursor crsCities'
      This.RowSourceType = 3
   ENDPROC
ENDDEFINE
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform