Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combos in grids that should depend one of each other
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01531225
Message ID:
01531226
Views:
55
>Hi everybody,
>
>I can use some help as what I've tried so far is all not working and producing error. I attached a picture demonstrating what I want.
>
>The grid's RecordSource is 'rsHolds' table. In this table I have LevelID, SectionID, Row fields and each of them I want to pick up from the combobox.
>
>Level restricts section selections and section dictates available rows.
>
>Here is the code in the Init of the form I tried:
>
>WITH thisform.grdHolds 
>  for each loColumn in .columns
>   
>      for each loControl in m.loColumn.controls
>         if upper(m.loControl.baseclass) = "HEADER"
>            loControl.Alignment = 2 
>            loControl.FontBold = .t.
>            bindevent(m.loControl,"Click",thisform,"HeaderClick")
>           
>         endif
>      next
>   next
>
>   with .colLevels.cboLevels
>      .rowsource = ''
>      .rowsourcetype = 3  
>      .rowsource = "select * from csrAllLevels where LevelID IS NOT NULL order by Descrip into cursor csrBLvls nofilter"
>      
>      .parent.ControlSource = 'rsHolds.LevelID'
>   endwith
>
>   with .colSections.cboSections
>      .rowsource = ''
>      .rowsourcetype = 3
>      .rowsource = "select * from csrAllSections where LevelID = ?m.nLevelID order by Descrip into cursor csrSect nofilter"
>	  .parent.ControlSource = 'rsHolds.SectionID'
>   endwith
>
> with .colRow.cboRows
>      .rowsource = ''
>      .rowsourcetype = 3
>      .rowsource = "select * from csrAllRows where LevelID = ?m.nLevelID and SectionID = ?m.nSectionID order by Row into cursor csrRows nofilter"
>      .parent.ControlSource = 'rsHolds.Row'
>   endwith
>
>*   .setall('DynamicFontStrikeThru','thisform.RefreshHoldsGrid()')
>   .refresh()
>endwith
>
>So, the grid does initially display. But as soon as I try to select anything in the combos, I start receiving messages about thisform is only available in a method and lots of other nasty errors.
>
>I'm not sure how to make this work.
>
>Thaks in advance.


You didn't have "thisform" anywhere in this code (or at least at a place where it could cause an error)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform