Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Smart dropdowns
Message
 
 
To
11/06/2001 13:19:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00517916
Message ID:
00517966
Views:
17
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
Previous
Reply
Map
View

Click here to load this message in the networking platform