Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid
Message
From
08/03/2000 10:42:45
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
08/03/2000 10:09:57
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Grid
Miscellaneous
Thread ID:
00343253
Message ID:
00343271
Views:
25
>How to insert the ID from parent's table while entering new records in the child's grid? Should I use BeforeRowColChange?
>
>Chuck


Chuck,
AfterRowColChange if you're gonna take that route. There are at least 3 ways. If you're using allowaddnew or append blank then you could use :

*AfterRowColChange
if empty(nvl(myChild.myId,""))
replace myChild.myId with myParent.ID
endif

Or :
in DBC set field's default value to something like :
iif(used("myParent"),myParent.ID,sys(2015))

If you're SQL inserting then you could just say :
insert into myChild (myId) values (myParent.ID)

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
Next
Reply
Map
View

Click here to load this message in the networking platform