Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combos in grids that should depend one of each other
Message
De
17/12/2011 12:22:27
Walter Meester
HoogkarspelPays-Bas
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01531225
Message ID:
01531261
Vues:
85
hi naomi,

The way we do this, is to requery the combobox in the when event. we populate the combos with an array that is a property on the combo itself


walter



>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform