Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table insert from combobox
Message
From
02/12/1999 20:49:03
 
 
To
02/12/1999 16:06:24
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00298163
Message ID:
00298243
Views:
22
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform