Hi achiary, patrick,
The dataset is created at runtime using a SQL pivot-instruction, so there really is no way to know on beforehand which columns the dataset will contain.
Our customer can define multiple of such rule sets and freely use columns of different tables.
I just put them horizontally on the same record using the Pivot instruction.
But as you say, the goal is indeed to create a dataset first and then create a common datasource for the forms using that dataset
- Code: Select all
dataset.createDataSource()
In the meanwhile, I found out that new records do get created in all foundsets of the forms which share the same dataSource.
Except, when the form to which I assign this new datasource was 'in use' but not visible. Then, you still can assign this new dataSource without a problem, but it does not follow the manipulation
of a foundset on another form sharign the same datasource.
My problem apparently, consists of creating and assigning the datasource in runtime to a form in use and that is a no-no as far as I can tell.
That is, I can perfectly assign the new dataSource to that form, but it doesn't follow the manipulation of the foundset of another form.
But patrick's solution helps me if i put his code in the events triggered when adding a new record. This way, I can 'tell' the form in use which does not follow to copy one's form foundset.
I'll see to get this working.
Thank you both
Chris