Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table insert from combobox
Message
De
02/12/1999 20:49:03
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00298163
Message ID:
00298243
Vues:
21
>I ahve a from with several child tables. One of those needs to have a new record added from the parebt form. What I would like to do is allow that to happen fron an existing combobox. The box has:
>
>Rowsourcetype = fields
>rowsource = child.text,child_key
>colums = 2
>bound colum = 2
>col widht = 50,0
>
>In the Lostfocus event, I would like to (p-code follows)
>if colum2 isnull
> insert into child (text) values (colum1)
> this.value = child.child_key
> this.requery
>endif
>this.refresh
>
>But I am darned if I can find a way in provided samples to check a single coloum.

If you bound to the second column (BoundColumn=2) then ComboBox.Value is linked with Child.Child_Key, i.e. NULL is really suspicious here. If you look to catch the case when textbox portion of combo has somethings that is not in its list portion then you should check (in Combo.LostFocus) for:
IF NOT (This.Value==This.DisplayValue)
*** insert record into table etc.
ENDIF
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform