[plug] OpenOffice.org data connection - Database for the rest of us

Craig Ringer craig at postnewspapers.com.au
Wed Jul 9 18:45:03 WST 2003


>>I haven't figured out how to get a writeable subquery though, at least
>>without using updateable views (these qualify as "the hard way" to do
>>simple things).

> If you create a child form that is a simple table view then you can do all the 
> normal data manipulation, update, delete add etc.

Yes, but it doesn't seem to be possible to ensure that it stays looking 
at the same record as the master form (in a single-table mode) or 
otherwise make what it shows dependent on the master form. You can do 
this with a query, but then you go back to the read-only issue.

> As I said, not tested yet, but seems to me it should work.
> The subforms are quite flexible and may be linked to multiple forms if needed.

Cool. The main thing I'm looking for is the ability to tell a child form 
to draw its data from a table, but track changes to a certain field in 
the master form so that it's always displaying the right record. Very 
similar to using a query, but instead of SELECTing just that data it 
only moves the db cursor to the correct record in the table.

It is much more complex when dealing with multiple tables in one 
subform, yes - that'd definitely be a candidate for an updateable view 
in the database.

So - do you know if there's a way to make a subform stay in synch with 
the master form while still displaying editable data? For example, 
consider a case where the master form is displaying a table of customers 
and the subform displays their contact details. When the user clicks on 
a customer in the master form the subform then updates to show that 
customers's details. This is easily done by making the subform's data 
source a SELECT statement, but this removes the ability to write changes 
to the subform back to the database. Instead, the idea would be to 
command the subform to skip to the correct customer ID in the customer 
details table so that the user could make changes. This would make it 
possible to have a read-only master form with a read/write subform, an 
awfully handy thing that doesn't seem possible right now if the subform 
is linked to the master form.

I suspect there's probably a way to do it with scripting, so that when 
the relevant field in the master form changes a script runs that tells 
the subform to skip to the correct record - however, it'd be nice to be 
able to specify this through the properties interface, and I hope there 
might be a way to do so hidden away somewhere.

Craig ringer




More information about the plug mailing list