>Hi all,
>
>Funny it seems I have never had to do this before so soliciting ideas...
>
>One form calls another form to allow the user to pick a few records to insert on the calling form (e.g. half a dozen rows, perhaps 5 fields each). I originally wrote this to have the user pick the records and then before the form closed, I would insert these rows into the underlying table and close the form. Then on the calling form, I would requery the view that displayed these records. But this view is also updatable to I also needed to write out any changes in the original view before requerying. This then seemed "wrong" because the user has a cancel button on that form - if they at that point pressed Cancel, all changes would be dumped *except* for the changes in the view that I had just written out. (I should note that the called form uses a different data session).
>
>So then I thought I had better only make changes to the original view by instead passing back any rows to be inserted and inserting these into the original view.
>
>I know that I can pass back an object from the called form as it's return value (and that object can contain an array of the rows to be inserted) but I am wondering if others routinely do something else? I guess I could pass back an XML string and create a new cursor out of that.
>
>Any other nice ways to pass data back (and while we are at it, passing data forward). Is there any way to pass a data session back and forth?
>
>Thanks,
>Albert
I see several ways.
- put the forms in same datasession, return alias
- return the data as array, rebuild the table
- return the data as a string, for example as XML, rebuild from that, a csv string, or a string to a temp csv file will do as well.
- create a temporary (free)
table not a cursor, a real table on your temp drive, return the path, open in calling form, read data delete table.
I use the temp table thing for a kind of general filter that is available to every form. For anything else I use same datasession.
HTH
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]