Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo will not display value after closed
Message
De
26/05/1999 03:40:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
25/05/1999 23:19:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00222776
Message ID:
00222809
Vues:
21
>Hi
>
>I have a form called OFFICES, in which I have three combo boxes I recently added. My problem is that after I select my values for the last two and close the form -- when I reopen the form the data is not displayed in the combo. However, it is being recorded in the table.
>
>Here are the details:
>
>A. cmbsourcestate
>B. cmbfields
>C. cmboption
>___________________
>
>A. cmbsourcestate:
>Rowsource = AL,FL
>Rowsourcetype: 1 -Value
>Control Source = offices.sourcestate
>bound = 1
>bound to = .T.
>
>B. cmbfields:
>Rowsource = voters_fields_pview.cfieldlabel,cfieldname
>Rowsourcetype = 6 fields
>Control Source = offices.cofficefield
>bound = 1
>bound to = .T.
>
>C. cmboption:
>Rowsource = voters_options_pview.cfielddetaillabel,cfielddetailoption
>Rowsourcetype = 6 - Fields
>Controlsource = offices.cofficeoptions
>bound = 1
>bound to = .T.
>
>
>These three combos are in a specific order, as I have listed .. a,b,c, because there is code in the interactivechange () that tells box two and three what to pull, based on the choices selected in a & b.
>
>
>I believe those are all the details. If anyone knows why cmb's B & C are not displaying the values I have selected in them after the form is closed and opened again, I would sure like to hear anyone thoughts.
>
>TIA
>
>Jason
Jason,
I'm not sure honestly. Referring to rowsources it sounds like they're parameterized views.
A combo to show up a value the value must exist in its list. ie: Your cofficefield = "11" then in related combo there should be "11" in items to show up. On entry parameters might be causing combo items not to contain a "11".
Well there is a better way than doing it with pviews. Pviews are SQL based so directly use SQL in combo rowsource.

B. cmbfields:
Rowsource = "select cfieldlabel,cfieldname "+;
"from myTable where something = thisform.somevalue into cursor myCursor"
Rowsourcetype = SQL
Control Source = offices.cofficefield
bound = 1
bound to = .T.

Then you would initially set thisform.somevalue to "" for chars. In gotfocus of combo :
* Combo.gotfocus 
* or lostfocus of another effecting this one - change this.requery then
thisform.somevalue = "DesiredValueHere"
this.requery()
* Combo.Lostfocus - seems dummy but prevents headaches in some cases
this.displayvalue = this.value
this.value = this.displayvalue
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform