Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lookup In Grid Formation
Message
De
11/08/1998 12:14:27
 
 
À
11/08/1998 12:01:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00125630
Message ID:
00125654
Vues:
16
>>>>>>I have a grid displayed on a form. One of the columns in the grid is a combobox which has as a sourse a field in a table. I want another column in the grid to display the contents of another field of the same table based on the entry selected in the combobox column. For example, the combo box displays a four letter code, in the table the code is associated with a specific crime (e.g., BURG is associated with Burglary). When "BURG" is selected in the combobox column how do I get "Burglary" to be displayed(entered) in the textbox column of the grid?
>>>>>>TIA
>>>>>>--lincoln
>>>>>
>>>>>You can reset Column1.Controlsource from Combo.InteractiveChange event.
>>>>
>>>>
>>>>I don't understand what you're telling me. What do I put where?
>>>
>>>***Combo.InteractiveChange event
>>>DO CASE
>>>CASE This.Value="BURG"
>>> Thisform.Grid1.Column1.Controlsource="table1.burglary"
>>>CASE ...
>>>...
>>>ENDCASE
>>>Thisform.Grid1.Refresh
>>
>>If the table only had a few enties this would be a fine solution, however there are too many entries in the table to list each value in a separate CASE command (it defeats the purpose of having it do a lookup since I could just tell it CASE column1 = "BURG"; column2.text1 = "Burglary". I need a way to have the value of coulumn1.combobox1 examined and the enter a value in column2.text1 based on the values in a row of the table in which both values are associated. I'm sure this can be done I am just stuck today and can't think how to do this.
>
>I'm sorry but I can't write code for your application, it's probably your responsibility. If you have many items then instead of CASE, you will use SEEK() or something similar, i.e. if you have to examine something then you should come up with algorithm of this examination. For example, you can add one more invisible column to the combo and keep there exact name of the field.

I used locate in the interactive change event of the combobox then if found I had the column2.text1 = value of table.field. It worked fine.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform