Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid: how do I change a column from txt to combo?
Message
De
17/11/2006 09:45:18
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
17/11/2006 08:18:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01170582
Message ID:
01170686
Vues:
18
>Thank you both! I'm still a little confused as to how to make the user's selection from the combo box populate some field in the grid's/child's table? e.g. if combobox's ControlSource is CITIES.CITY, how do I make the CITY field in the child table (say CUSTOMER.CITY) get populated with CITIES.CITY. I am sure it's easily done with some event. I am just curious if the grid and comboboxes have properties that directly allow for this?
>
>Update:
>In playing around with a combobox that I simply added to the form (not to the grid yet), I am confused about ControlSource versus RowSource. I imagine that I could set RowSourceType =Alias and RowSource=CITIES. But how do I specify what field from CITIES is used? Is that where ControlSources is used? If so, why does ControlSource offer a list of all tables/fields from the form's DE? I would think it already knows the RowSource=CITIES - so shouldn't ControlSource only offer a list of fields from the RowSource table/alias?

As with any other control, ControlSource is where you want the user's entered or selected value to go - that'd be the field (with alias) in your child table.

RowSource for listboxes and combos is tells them where to get the displayable rows. In your case, I'd go for rowsourcetype=6 (fields) and rowsource="cities.city". So it will display whatever it finds in cities.city, and store the user's selection in customer.city.

>
>Update 2:
>WOW, what a learning curve :) I pretty much figured out how to configure comboboxes that are populated with multiple fields from an alias. How odd that you get an error if you enter the alias name more than once for fields listed in RecordSource (e.g. RecordSource = "MyAlias.field1, MyAlias.field2" is invalid, but "MyAlias.field1, field2" is correct!). I can see learning VFP is going to be like learning English - lots of exceptions and surprises :)

Welcome to the club :). You have the advantage, though - us. Many of us didn't have this sort of help when we were learning these things.

>Sure would have been sweet if the PEM popped up a list of all fields and you could do a multi-select to set which fields will appear in combobox/list and their order. Now that would have been much more intuitive to a newbie :)

You may try the expression builder - the button to the left of the combo in the PEM window - though it's limited to the tables already open in form's DE. If you're dealing with a form class, or a form without a DE (dataenvironment), it won't show them. You may, using a builder as I've shown in the first message, do this in the command window:
use cities
getexpr to oCol.RowSource
to the same effect, and with a bit more control over what you see in it and what not.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform