Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question about Grid Control.
Message
From
30/04/1998 05:20:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00095440
Message ID:
00095898
Views:
25
>I think my explanation was not proper last time.
>I made a view(named as myview) whose SQL code is as the followings,
>
>SELECT target.*, source.medicine_name;
> FROM hospital!target LEFT OUTER JOIN hospital!source ;
> ON target.medicine_code = source.medicine_code
>
>After I let the ¡°source.medicine_name¡± as not updatable on the view
>Designer,
>I tried to do as the followings,
>
>Append Blank
>Replace myview.code with something
>Replace myview.pa_id with something
>Replace myview.Date with date()
>
>But it generate an error like ¡°Can not insert an empty row from a view into it¡¯s base table.¡±
>Whenever I try to requery().
>As I told you, I used grid controls and it does not display medicine_name dynamically
>according to the Change of medicine_code.
>
>There are two tables related to this topic.
>One is the basic list of medicines and it¡¯s code.
>The other is a list of medicines needed for certain person.
>
>Well I¡¯m still haven¡¯t found what I¡¯m looking for.
>
>
>>Hi Kim,
>>Include the medicine_name in view as !updatable. I think it would be easiest.
>>Cetin
Kim,
Tableupdate() is being a problem there as I see (more than one pkey defined ? etc), since all you want to do is to show medicine_name this could be a better and easy solution :
*Add a column to grid for medicinename - medname
grid.medname.controlsource=;
   iif(seek(target.code,"source","code"),source.medicine_name,"")
This would make a calculated field which is readonly (what you need). And more, for this you wouldn't need a view (if other tables also don't participate), this would work with buffering too (where relation fail till tableupdate()).
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
Previous
Reply
Map
View

Click here to load this message in the networking platform